History and Background Part 3: Polyalphabetic Ciphers CSCI 5857: Encoding and Encryption
Outline The Vigenére polyalpabetic cipher Enigma One-time pads
Polyalphabetic Substitution Single plaintext character may map to multiple possible ciphertext characters Character mapped to depends on position in plaintext Ci = f(pi, i) Frequency analysis attacks much harder
Vigenére cipher Key = some word or phrase of length n ci = (pi + ki mod n) mod 26 Example: Key: “python” Plaintext: “rabbitwithbigpointyteeth”
Vigenére Cipher Example Create table with plaintext in one row, key in next row If size of key < plaintext, repeat as necessary “Add” values in corresponding column to get ciphertext r+p = 17+15 = 6 = G a+y = 0+24 = 24 = Y b+t = 1+19 = 20 = U b+h = 1+7 = 8 = I (note difference!)
Frequency Analysis Vigenére cipher still vulnerable to frequency-based cryptanalysis Guess key size n Treat like n different monoalphabetic substitutions General principle: Larger n more secure (that is, number of characters before repetition)
Enigma Developed by Germany in WW2 Arguably most complex pre-computer substitution cipher Flash simulation at http://enigmaco.de/enigma/enigma.html
Enigma Structure Consists of 3 to 5 rotors Each rotor is a monoalphabetic mapping of a plaintext character to a ciphertext character Output of one rotor fed into input of next rotor so final output the result of 3 to 5 monoalphabetic substitutions Rotors turn after each character! Fast rotor: every character Middle rotor: every 26 characters Slow rotor: every 26 x 26 = 676 characters
Enigma Diagram
Enigma Analysis 26 x 26 x 26 = 17,576 characters entered before repetition Essentially invulnerable to frequency-based cryptanalysis (particularly if rotors changed at regular intervals) Required Alan Turing’s Bletchley Group to crack Captured machines to understand patterns Large numbers of known plaintexts Exhaustive searches using primitive computers
One-Time Pad Idea: Make key as long as the message itself! (Joseph Mauborgne) Unconditionally secure since inherently ambiguous for attacker Only example of an unconditionally secure encryption algorithm
One-Time Pad Example Example ciphertext: NZAKBMK Ciphertext: NZAKBMK NZAKBMK Possible keys: nlvwker wtnkxmm Plaintext: goforit runaway Which key is correct? We have no way of knowing since both are plausible plaintext!
One-Time Pad Weakness Only get to use a key for one message Unlikely that different possible keys would still both result in plausible plaintext for more than one message Adversary could find correct key by process of elimination Ciphertext: WMGKZX WMGKZX Possible keys: nlvwke wtnkxm Plaintext: jblopt attack Would need to securely distribute a new key for each message! “This is the one!”
What’s Next Let me know if you have any questions Continue on to the next lecture on transposition ciphers