Vigenere cipher Asad Gondal Ali Haider Mansoor 1

  • Slides: 13
Download presentation
Vigenere cipher Asad Gondal Ali Haider Mansoor 1

Vigenere cipher Asad Gondal Ali Haider Mansoor 1

Presentation Outline • Vigenere cipher. • Attacks on Vigenere : Kasisky Test 2

Presentation Outline • Vigenere cipher. • Attacks on Vigenere : Kasisky Test 2

Towards the Polyalphabetic Substitution Ciphers • Main weaknesses of monoalphabetic substitution ciphers – In

Towards the Polyalphabetic Substitution Ciphers • Main weaknesses of monoalphabetic substitution ciphers – In ciphertext, different letters have different frequency • each letter in the ciphertext corresponds to only one letter in the plaintext letter • Idea for a stronger cipher (1460’s by Alberti) – Use more than one cipher alphabet, and switch between them when encrypting different letters • As result, frequencies of letters in ciphertext are similar • Developed into a practical cipher by Vigenère (published in 1586) 3

The Vigenère Cipher Treat letters as numbers: [A=0, B=1, C=2, …, Z=25] Number Theory

The Vigenère Cipher Treat letters as numbers: [A=0, B=1, C=2, …, Z=25] Number Theory Notation: Zn= {0, 1, …, n-1} Definition: Given m, a positive integer, P = C = (Z 26)n, and K = (k 1, k 2, … , km) a key, we define: Encryption: ek(p 1, p 2… pm) = (p 1+k 1, p 2+k 2…pm+km) (mod 26) Decryption: dk(c 1, c 2… cm) = (c 1 -k 1, c 2 -k 2 … cm- km) (mod 26) Example: Plaintext: C R Y P T O G R A P H Y Key: L U C K Ciphertext: N L A Z E I I B L J J I 4

Security of Vigenere Cipher • Vigenere masks the frequency with which a character appears

Security of Vigenere Cipher • Vigenere masks the frequency with which a character appears in a language: one letter in the ciphertext corresponds to multiple letters in the plaintext. Makes the use of frequency analysis more difficult. • Any message encrypted by a Vigenere cipher is a collection of as many shift ciphers as there are letters in the key. 5

Vigenere Cipher: Cryptanalysis • Find the length of the key. • Divide the message

Vigenere Cipher: Cryptanalysis • Find the length of the key. • Divide the message into that many simple substitution encryptions. • Solve the resulting simple substitutions. – how? 6

How to Find the Key Length? • For Vigenere, as the length of the

How to Find the Key Length? • For Vigenere, as the length of the keyword increases, the letter frequency shows less English-like characteristics and becomes more random. • Two methods to find the key length: – Kasisky test – Index of coincidence (Friedman) 7

Kasisky Test • The Kasiski examination, also called the Kasiski test, takes advantage of

Kasisky Test • The Kasiski examination, also called the Kasiski test, takes advantage of the fact that repeated words may, by chance, sometimes be encrypted using the same key letters, leading to repeated groups in the ciphertext. • For example, Consider the following encryption using the keyword ABCD: 8

Example of the Kasisky Test • Key: ABCDABCDABCDABCD Plaintext: CRYPTOISSHORTFORCRYPTOGRAPHY Ciphertext: CSASTPKVSIQUTGQUCSASTPIUAQJB 9

Example of the Kasisky Test • Key: ABCDABCDABCDABCD Plaintext: CRYPTOISSHORTFORCRYPTOGRAPHY Ciphertext: CSASTPKVSIQUTGQUCSASTPIUAQJB 9

Kasisky Test • There is an easily seen repetition in the ciphertext, and the

Kasisky Test • There is an easily seen repetition in the ciphertext, and the Kasiski test will be effective. • Here the distance between the repetitions of CSASTP is 16. • . Assuming that the repeated segments represent the same plaintext segments, this implies that the key is 16, 8, 4, 2, or 1 characters long. 10

Kasisky Test • The following ciphertext has two segments that are repeated: • Ciphertext:

Kasisky Test • The following ciphertext has two segments that are repeated: • Ciphertext: VHVSSPQUCEMRVBVBBBVHVSURQGIBDUG RNICJQUCERVUAXSSR 11

Kasisky Test • The distance between the repetitions of VHVS is 18. • Assuming

Kasisky Test • The distance between the repetitions of VHVS is 18. • Assuming that the repeated segments represent the same plaintext segments, this implies that the key is 18, 9, 6, 3, 2, or 1 characters long. • The distance between the repetitions of QUCE is 30 characters. 12

Kasisky Test • This means that the key length could be 30, 15, 10,

Kasisky Test • This means that the key length could be 30, 15, 10, 6, 5, 3, 2, or 1 characters long. • By taking the intersection of these sets one could safely conclude that the most likely key length is 6, since 3, 2, and 1 are unrealistically short. 13