Security of Networks (12) Exercises

Similar documents
CODING AND CRYPTOLOGY III CRYPTOLOGY EXERCISES. The questions with a * are extension questions, and will not be included in the assignment.

Classical Cryptography

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

Sol: First, calculate the number of integers which are relative prime with = (1 1 7 ) (1 1 3 ) = = 2268

} has dimension = k rank A > 0 over F. For any vector b!

The Vigenère cipher is a stronger version of the Caesar cipher The encryption key is a word/sentence/random text ( and )

University of Regina Department of Mathematics & Statistics Final Examination (April 21, 2009)

Cryptography CS 555. Topic 2: Evolution of Classical Cryptography CS555. Topic 2 1

Chapter 2 Classical Cryptosystems

MATH3302 Cryptography Problem Set 2

Shift Cipher. For 0 i 25, the ith plaintext character is. E.g. k = 3

Candidates must show on each answer book the type of calculator used. Only calculators permitted under UEA Regulations may be used.

Public Key Cryptography

MONOALPHABETIC CIPHERS AND THEIR MATHEMATICS. CIS 400/628 Spring 2005 Introduction to Cryptography

What is Cryptography? by Amit Konar, Dept. of Math and CS, UMSL

Attempt QUESTIONS 1 and 2, and THREE other questions. penalised if you attempt additional questions.

... Assignment 3 - Cryptography. Information & Communication Security (WS 2018/19) Abtin Shahkarami, M.Sc.

Solutions to the Midterm Test (March 5, 2011)

Polyalphabetic Ciphers

Classical Cryptography

CPSC 467b: Cryptography and Computer Security

Written examination. Tuesday, August 18, 2015, 08:30 a.m.

Lecture Notes. Advanced Discrete Structures COT S

Lecture 12: Block ciphers

Introduction to Cryptology. Lecture 2

Univ.-Prof. Dr. rer. nat. Rudolf Mathar. Written Examination. Cryptography. Tuesday, August 29, 2017, 01:30 p.m.

Private-key Systems. Block ciphers. Stream ciphers

About Vigenere cipher modifications

Data and information security: 2. Classical cryptography

Winter 2008 Introduction to Modern Cryptography Benny Chor and Rani Hod. Assignment #2

CSCI3381-Cryptography

then the hard copy will not be correct whenever your instructor modifies the assignments.

monoalphabetic cryptanalysis Character Frequencies (English) Security in Computing Common English Digrams and Trigrams Chapter 2

Exercise Sheet Cryptography 1, 2011

THE UNIVERSITY OF CALGARY FACULTY OF SCIENCE DEPARTMENT OF COMPUTER SCIENCE DEPARTMENT OF MATHEMATICS & STATISTICS MIDTERM EXAMINATION 1 FALL 2018

Jay Daigle Occidental College Math 401: Cryptology

Friedman s Index of Coincidence and. Estimation of Keyword Length

10 Modular Arithmetic and Cryptography

Know the meaning of the basic concepts: ring, field, characteristic of a ring, the ring of polynomials R[x].

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

Tutorial on Quantum Computing. Vwani P. Roychowdhury. Lecture 1: Introduction

Lecture 8 - Cryptography and Information Theory

Classical Cryptography

Cryptography. P. Danziger. Transmit...Bob...

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

Week 7 An Application to Cryptography

Real scripts backgrounder 3 - Polyalphabetic encipherment - XOR as a cipher - RSA algorithm. David Morgan

2.7 The Friedman and Kasiski Tests

Lattices. A Lattice is a discrete subgroup of the additive group of n-dimensional space R n.

Introduction to Cryptography

NET 311D INFORMATION SECURITY

U.C. Berkeley CS276: Cryptography Luca Trevisan February 5, Notes for Lecture 6

A block cipher enciphers each block with the same key.

Shannon s Theory of Secrecy Systems

Ma/CS 6a Class 2: Congruences

ECE 646 Lecture 5. Motivation: Mathematical Background: Modular Arithmetic. Public-key ciphers. RSA keys. RSA as a trap-door one-way function

Homework Problems, Math 134, Spring 2007 (Robert Boltje)

Lecture Notes. Advanced Discrete Structures COT S

Introduction to Cryptology Dr. Sugata Gangopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Roorkee

Alternative Approaches: Bounded Storage Model

Klein s and PTW Attacks on WEP

Math 430 Midterm II Review Packet Spring 2018 SOLUTIONS TO PRACTICE PROBLEMS

Cryptography. Lecture 2: Perfect Secrecy and its Limitations. Gil Segev

Innovation and Cryptoventures. Cryptology. Campbell R. Harvey. Duke University, NBER and Investment Strategy Advisor, Man Group, plc.

Notes 4: Stream ciphers, continued. Recall from the last part the definition of a stream cipher:

Introduction to Cryptography

The Hill Cipher A Linear Algebra Perspective

5. Classical Cryptographic Techniques from modular arithmetic perspective

ECE596C: Handout #11

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

Cryptography and Security Midterm Exam

Math 1350 (FALL 2008) Prelim 1 (10/6/2008) 1. Solution. For the Atbash cipher for the Roman alphabet we have

The Evolution of Cryptology

MATH 158 FINAL EXAM 20 DECEMBER 2016

Solution to Midterm Examination

Fall 2017 September 20, Written Homework 02

Notes 10: Public-key cryptography

Joseph Fadyn Kennesaw State University 1100 South Marietta Parkway Marietta, Georgia

Classic Cryptography Tutorial. c Eli Biham - May 3, Classic Cryptography Tutorial (3)

Implementation Tutorial on RSA

Homework #2 solutions Due: June 15, 2012

19 Lorenz Cipher Machine

Math 223, Spring 2009 Final Exam Solutions

Using Matrices for Cryptography

INVERSE OF A MATRIX [2.2] 8-1

Discrete Mathematics GCD, LCM, RSA Algorithm

Cook-Levin Theorem. SAT is NP-complete

Solutions for week 1, Cryptography Course - TDA 352/DIT 250

Background: Lattices and the Learning-with-Errors problem

Unpredictable Binary Strings

CRYPTOGRAPHY AND NUMBER THEORY

Logic gates. Quantum logic gates. α β 0 1 X = 1 0. Quantum NOT gate (X gate) Classical NOT gate NOT A. Matrix form representation

Simple Codes MTH 440

SCHOOL OF MATHEMATICS AND STATISTICS

MODULAR ARITHMETIC. Suppose I told you it was 10:00 a.m. What time is it 6 hours from now?

Public Key Cryptography

CPSC 467b: Cryptography and Computer Security

3F1: Signals and Systems INFORMATION THEORY Examples Paper Solutions

Elliptic Curves. Giulia Mauri. Politecnico di Milano website:

CPA-Security. Definition: A private-key encryption scheme

Transcription:

(12) Exercises 1.1 Below are given four examples of ciphertext, one obtained from a Substitution Cipher, one from a Vigenere Cipher, one from an Affine Cipher, and one unspecified. In each case, the task is to determine the plaintext. Give a clearly written description of the steps you followed to decrypt each ciphertext. This should include all statistical analysis and computations you performed. The first two plaintexts were taken from The Diary of Samuel Marchbanks, by Robertson Davies, Clarke Irwin, 1947; the fourth was taken from Lake Wobegon Days, by Garrison Keillor, Viking Penguin, Inc., 1985. (a) Substitution Cipher: EMGLOSUDCGDNCUSWYSFHNSFCYKDPUMLWGYICOXYSIPJCK QPKUGKMGOLICGINCGACKSNISACYKZSCKXECJCKSHYSXCG OIDPKZCNKSHICGIWYGKKGKGOLDSILKGOIUSIGLEDSPWZU GFZCCNDGYYSFUSZCNXEOJNCGYEOWEUPXEZGACGNFGLKNS ACIGOIYCKXCJUCIUZCFZCCNDGYYSFEUEKUZCSOCFZCCNC IACZEJNCSHFZEJZEGMXCYHCJUMGKUCY HINT F decrypts to w. (b) Vigenere Cipher: KCCPKBGUFDPHQTYAVINRRTMVGRKDNBVFDETDGILTXRGUD DKOTFMBPVGEGLTGCKQRACQCWDNAWCRXIZAKFTLEWRPTYC QKYVXCHKFTPONCQQRHJVAJUWETMCMSPKQDYHJVDAHCTRL SVSKCGCZQQDZXGSFRLSWCWSJTBHAFSIASPRJAHKJRJUMV GKMITZHFPDISPZLVLGWTFPLKKEBDPGCEBSHCTJRWXBAFS PEZQNRWXCVYCGAONWDDKACKAWBBIKFTIOVKCGGHJVLNHI FFSQESVYCLACNVRWBBIREPBBVFEXOSCDYGZWPFDTKFQIY CWHJVLNHIQIBTKHJVNPIST (c) Affine Cipher: KQEREJEBCPPCJCRKIEACUZBKRVPKRBCIBQCARBJCVFCUP KRIOFKPACUZQEPBKRXPEIIEABDKPBCPFCDCCAFIEABDKP BCPFEQPKAZBKRHAIBKAPCCIBURCCDKDCCJCIDFUIXPAFF ERBICZDFKABICBBENEFCUPJCVKABPCYDCCDPKBCOCPERK IVKSCPICBRKIJPKABI Dr. S.B. Sadkhan Page 1

(d) unspecified cipher: BNVSNSIHQCEELSSKKYERIFJKXUMBGYKAMQLJTYAVFBKVT DVBPVVRJYYLAOKYMPQSCGDLFSRLLPROYGESEBUUALRWXM MASAZLGLEDFJBZAVVPXWICGJXASCBYEHOSNMULKCEAHTQ OKMFLEBKFXLRRFDTZXCIWBJSICBGAWDVYDHAVFJXZIBKC GJIWEAHTTOEWTUHKRQVVRGZBXYIREMMASCSPBNLHJMBLR FFJELHWEYLWISTFVVYFJCMHYUYRUFSFMGESIGRLWALSWM NUHSIMYYITCCQPZSICEHBCCMZFEGVJYOCDEMMPGHVAAUM ELCMOEHVLTIPSUYILVGFLMVWDVYDBTHFRAYISYSGKVSUU HYHGGCKTMBLRX (a) How many 2 2 matrices are there that are invertible over? (b) Let p be prime. Show that the number of 2 2 matrices that are invertible over is (p2-1)(p2 - p). HINT Since p is prime, is a field. Use the fact that a matrix over a field is invertible if and only if its rows are linearly independent vectors (i.e., there does not exist a non-zero linear combination of the rows whose sum is the vector of all 0 s). (c) For p prime, and m 2 an integer, find a formula for the number of m m matrices that are invertible over. 1.2 We describe a special case of a Permutation Cipher. Let m, n be positive integers. Write out the plaintext, by rows, in m n rectangles. Then form the ciphertext by taking the columns of these rectangles. For example, if m = 4, n = 3, then we would encrypt the plaintext cryptography by forming the following rectangle: cryp togr aphy The ciphertext would be CTAROPYGHPRY. (a) Describe how Bob would decrypt a ciphertext (given values for m and n). (b) Decrypt the following ciphertext, which was obtained by using this method of encryption: MYAMRARUYIQTENCTORAHROYWDSOYEOUARRGDERNOGW Dr. S.B. Sadkhan Page 2

1.3 There are eight different linear recurrences over of degree four having c0= 1. Determine which of these recurrences give rise to a keystream of period 15 (given a non-zero initialization vector). 1.9 The purpose of this exercise is to prove the statement made in Section 1.2.5 that the m m coefficient matrix is invertible. This is equivalent to saying that the rows of this matrix are linearly independent vectors over. As before, we suppose that the recurrence has the form (z1,..., zm) comprises the initialization vector. For i 1, define Note that the coefficient matrix has the vectors v1,..., vm as its rows, so our objective is to prove that these m vectors are linearly independent. Prove the following assertions: (a) For any i 1, (b) Choose h to be the minimum integer such that there exists a nontrivial linear combination of the vectors v1,..., vh which sums to the vector (0,..., 0) modulo 2. Then and not all the j s are zero. Observe that h m + 1, since any m + 1 vectors in an mdimensional vector space are dependent. (c) Prove that the keystream must satisfy the recurrence for any i 1. (d) Observe that if h m, then the keystream satisfies a linear recurrence of degree less than m, a contradiction. Hence, h = m + 1, and the matrix must be invertible. Dr. S.B. Sadkhan Page 3

1.5 We describe a stream cipher that is a modification of the Vigenere Cipher. Given a keyword (K1,..., Km) of length m, construct a keystream by the rule zi= Ki(1 i m), zi+ m = zi+ 1 mod26 (i m + 1). In other words, each time we use the keyword, we replace each letter by its successor modulo 26. For example, if SUMMER is the keyword, we use SUMMER to encrypt the first six letters, we use TVNNFS for the next six letters, and so on. Describe how you can use the concept of index of coincidence to first determine the length of the keyword, and then actually find the keyword. Test your method by cryptanalyzing the following ciphertext: IYMYSILONRFNCQXQJEDSHBUIBCJUZBOLFQYSCHATPEQGQ JEJNGNXZWHHGWFSUKULJQACZKKJOAAHGKEMTAFGMKVRDO PXNEHEKZNKFSKIFRQVHHOVXINPHMRTJPYWQGJWPUUVKFP OAWPMRKKQZWLQDYAZDRMLPBJKJOBWIWPSEPVVQMBCRYVC RUZAAOUMBCHDAGDIEMSZFZHALIGKEMJJFPCIWKRMLMPIN AYOFIREAOLDTHITDVRMSE The plaintext was taken from The Codebreakers, by D. Kahn, Macmillan, 1967. 2.16 Suppose S1is the Shift Cipher (with equiprobable keys, as usual) and S 2 is the Shift Cipher where keys are chosen with respect to some probability distribution (which need not be equiprobable). Prove that S 1 S 2 = S 1. 2.17 Suppose S 1 and S 2 are Vigenere Ciphers with keyword lengths m 1, m 2 respectively, where m 1 > m 2. (a) If m 2 m 1, then show that S 2 S 1 = S 1. (b) One might try to generalize the previous result by conjecturing that S 2 S 1 = S 3, where S 3 is the Vigenere Cipher with keyword length lcm(m 1, m 2 ). Prove that this conjecture is false. HINT If mod m 2, then the number of keys in the product cryptosystem S 2 S 1 is than the number of keys in S 3. Dr. S.B. Sadkhan Page 4

1. Problem: The following ciphertext was enciphered using the Vigenere cipher. How can we decipher it? Answer: We need to use Friedman s index of coincidence combined with Kasiski s test. The Kasiski Test 2. Example: Encipher the message:...on A PLANE. THE PLANE IS DUE... using the Vigenere cipher with keywords Dr. S.B. Sadkhan Page 5

(a) WATER (b) MILK 3. Kasiski s test. If a string of characters appears repeatedly in a polyalpha- betic ciphertext message, it is possible (though not certain) that the distance between the occurences is a multiple of the length of the keyword 4. Example. Determine a likely Vigenere keyword length for the following ciphertext: Solution: There are repeated letter groups: The separation (start to start) between the two occurrences of is 108 33 22 letters, and the separation between those of is 18 32 2 letters. Common divisors of these two numbers are 2369, and 18, Dr. S.B. Sadkhan Page 6

and so these are the most likely keyword lengths. 5. Exercise. Use Kasiski s test to find the more likely keyword lengths in Prob- lem 1. (Hint: There are repeated strings beginning with, with and with ). Solution: 6. Exercise: The ciphertext in Problem 1 contains the following distribution of letters: letter A B C D E F G H I J K L M 18 31 24 9 9 15 12 12 27 14 17 5 24 letter N O P Q R S T U V W X Y Z 23 28 6 13 29 28 7 5 24 41 20 11 8 Suppose that a pair of letters is selected at random from this text. What is the probability that the two letters selected will be identical? Solution:?????? Dr. S.B. Sadkhan Page 7

7. Friedman s Index of Coincidence The index of coincidence (denoted by I) for a (cipher)text is the probability that two letters selected at random from it are identical. If the text has n 0 A s, n 1 B s, n 2 C s,..., n 25 Z s, and n = n 0 + n 1 + n 2 + + n 25 is the number of letters in the text, then In the previous exercise, we found I = 0.04713. 8. Example: What is the index of coincidence for a collection of 2600 letters consisting of 100 A s, 100 B s, 100 C s,..., 100 Z s? Solution:?????????????? 9. Remark. The index of coincidence of a totally random (uniformly distributed) collection of letters is about 0.0385. Vigenere ciphertexts from longer keywords have a more uniform distribution of letters. For keyword lengths closer to 1, the index of coincidence will be larger (closer to 0.0656). 10. Question: Can we quantify the connection between index of coincidence and keyword length? 11. Connection between index of coincidence I and keyword length. Suppose that the ciphertext has n letters and the Vigenere keyword has k letters. Then Dr. S.B. Sadkhan Page 8

The separation (start to start) between the two occurrences of is 108 33 22 letters, and the separation between those of is 18 Dr. S.B. Sadkhan Page 9

32 2 letters. Common divisors of these two numbers are 2369, and 18, and so these are the most likely keyword lengths. Dr. S.B. Sadkhan Page 10