Presentation is loading. Please wait.

Presentation is loading. Please wait.

Announcements: Pass in Assignment 1 now Pass in Assignment 1 now Meet my assistant Kevin Reed Meet my assistant Kevin Reed Assignment 2 (tentative) posted.

Similar presentations


Presentation on theme: "Announcements: Pass in Assignment 1 now Pass in Assignment 1 now Meet my assistant Kevin Reed Meet my assistant Kevin Reed Assignment 2 (tentative) posted."— Presentation transcript:

1 Announcements: Pass in Assignment 1 now Pass in Assignment 1 now Meet my assistant Kevin Reed Meet my assistant Kevin Reed Assignment 2 (tentative) posted Assignment 2 (tentative) postedQuestions? Today: Finish Vigenere, start Hill ciphers DTTF/NB479: DszquphsbqizDay 6

2 Idea: the key is a vector of shifts Ex. Use a word like hidden (7 8 3 3 4 13). Ex. Use a word like hidden (7 8 3 3 4 13). Example: Example: The recent development of various methods of 7 8 3 3 413 7 8 3 3 413 7 8 3 3 413 7 8 3 3 413 7 8 3 3 4 13 7 8 3 3 413 7 8 7 8 3 3 413 7 8 3 3 413 7 8 3 3 413 7 8 3 3 413 7 8 3 3 4 13 7 8 3 3 413 7 8 015 7 20 815112122 6 8 811191718161720 1 17 8 25132416172322 2511 11017 7 5 2113 015 7 20 815112122 6 8 811191718161720 1 17 8 25132416172322 2511 11017 7 5 2113 aph uiplvw giiltrsqrub ri znyqrxw zlbkrhf vnEncryption: Repeat the vector as many times as needed to get the same length as the plaintext Repeat the vector as many times as needed to get the same length as the plaintext Add this repeated vector to the plaintext. Add this repeated vector to the plaintext. Demo Demo Vigenere Ciphers

3 Summary from yesterday What makes a Vigenere cipher more secure than a shift cipher? How do we find the key length? Why does the max of dot(A 0,A i ) occur when i==0? What are the advantages and disadvantages of using the dot product method (method 2) vs. method 1 to decrypt the key?

4 English letter frequencies A 0.082 B 0.015 C 0.028 D 0.043 E 0.127 F 0.022 G 0.020 H 0.061 I 0.070 J 0.002 K 0.008 L 0.040 M 0.024 N 0.067 O 0.075 P 0.019 Q 0.001 R 0.060 S 0.063 T 0.091 U 0.028 V 0.010 W 0.023 X 0.001 Y 0.020 Z 0.001 Graph:

5 Finding the key length What if the frequency of letters in the plaintext approximates A? Then for each k, frequency of each group of letters in position p = k (mod L) in the ciphertext approximates A. Then loop, displacing the ciphertext by i, and counting the number of coincidences. Get max when displace by correct key length Get max when displace by correct key length So just look for the max! So just look for the max!shift APHUIPLVWGIILTRSQRUBRIZNYQRXWZLBKRHFVN (0) NAPHUIPLVWGIILTRSQRUBRIZNYQRXWZLBKRHFV (1) VNAPHUIPLVWGIILTRSQRUBRIZNYQRXWZLBKRHF (2) … KRHFVNAPHUIPLVWGIILTRSQRUBRIZNYQRXWZLB (6) 5 matches

6 Visualization http://www.usafa.af.mil/df/dfcs/acis/applets /Vigenere.html http://www.usafa.af.mil/df/dfcs/acis/applets /Vigenere.html Play with now and for homework Thanks to Dr. Dino Schweitzer, USAFA, who I met last Friday, for pointing me to his demo! Aren’t you glad I was at SIGCSE?

7 Vigenere Closing Thought What if we modified the Vigenere cipher so that each individual letter was not simply shifted, but the result of an affine function?

8 Block Ciphers So far, changing 1 character in the plaintext changes ___ characters in the ciphertext. Shannon outlined qualities of good ciphers: Diffusion: Changing one character of the plaintext changes _____ characters in the ciphertext Diffusion: Changing one character of the plaintext changes _____ characters in the ciphertext Makes frequency analysis much tougher! Confusion: Each character of the ciphertext interacts with several parts of the key Confusion: Each character of the ciphertext interacts with several parts of the key Block ciphers have both qualities: DES (64 bits), AES (128 bits), Hill ciphers (smaller; today) DES (64 bits), AES (128 bits), Hill ciphers (smaller; today)

9 Hill Ciphers Lester Hill, 1929. Not used much, but first time linear algebra used in crypto Use an n x n matrix M. Encrypt by breaking plaintext into blocks of length n (padding with x’s if needed) and multiplying each by M. Example: Encrypt “ Example: Encrypt “ hereissomeonetoencrypt” using M her eis som eon eto enc ryp txx ( 7, 4, 17) (4, 8, 18) … (19, 23, 23) (2, 5, 25) (0, 2, 22) … (0, 22, 15) cfz acw yga vns ave anc sdd awp “CFZACWYGAVNSAVEANCSDDAWP”

10 Decrypting Reverse the process, multiplying each block by M inverse Theorem: If a matrix M is invertible mod n, then gcd(det(M), n) = 1 Proof on board (uses a lemma from Ch 3)

11 How to break via known plaintext? Think about this…

12 Does this cipher exhibit diffusion?


Download ppt "Announcements: Pass in Assignment 1 now Pass in Assignment 1 now Meet my assistant Kevin Reed Meet my assistant Kevin Reed Assignment 2 (tentative) posted."

Similar presentations


Ads by Google