Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 5857: Encoding and Encryption

Similar presentations


Presentation on theme: "CSCI 5857: Encoding and Encryption"— Presentation transcript:

1 CSCI 5857: Encoding and Encryption
History and Background Part 2: Polyalphabetic Substitution and Transposition CSCI 5857: Encoding and Encryption

2 Outline The Vigenére polyalpabetic cipher Enigma One-time pads
Transposition ciphers Attacks on transposition ciphers Effectiveness of using multiple keys Avalanche effect as a goal of encryption Kerckhoff’s Principle

3 Polyalphabetic Substitution
Single plaintext character may map to multiple possible ciphertext characters Frequency analysis attacks much harder Example: Vigenére cipher Key = some word or phrase of length n ci = (pi + ki mod n) mod 26

4 Vigenére cipher

5 Vigenére cipher Example: Key: “python”
Plaintext: “rabbitwithbigpointyteeth” Ciphertext: r a b i t w h g p o n y e p y t h o n G Y U I V L M N H P B R

6 Polyalphabetic Substitution
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)

7 Enigma Developed by Germany in WW2
Arguably most complex pre-computer substitution cipher Flash simulation at

8 Enigma Consists of 3 to 5 rotors Rotors turn after each character!
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

9 Enigma

10 Enigma 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

11 One-Time Pad Idea: Make key as long as the message itself! (Joseph Mauborgne) Unconditionally secure since inherently ambiguous for attacker

12 One-Time Pad 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! ???

13 One-Time Pad 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!”

14 Transposition Cipher Ciphertext = Permutation of plaintext
Simple example: runaway  r n w y u a a  rnwyuaa Key = permutation order Above example:

15 Column Transposition Ciphers
Break plaintext into columns Example plaintext: longlongagoinagalaxyfaraway Key: (size n of key = 7 columns) longlon gagoina galaxyf arawayx Break plaintext into rows of size n of key Insert extra chars to fill columns (padding)

16 Column Transposition Ciphers
l o n g l o n g a g o i n a g a l a x y f a r a w a y x For column with label i: Append contents of column i to ciphertext Resulting ciphertext: goaw oaar nafx ngla lgga onyy lixa This column first This column second, and so on

17 Column Transposition Ciphers
Decryption: Divide ciphertext into n strings Arrange strings into columns, with order of columns determined by key goawoaarnafxnglalggaonyylixa l o n g l o n g a g o i n a g a l a x y f a r a w a y x

18 Attacks on Transposition Ciphers
Brute force: Trying all possible permutations Key of size n  n! possible keys Solution: Choose key such that n! tests is computationally secure Cryptographic attacks: Eliminate column pairs with unlikely adjacent letters l i x a n a f x

19 Attacks on Transposition Ciphers
Can apply transposition multiple times with same key to defeat cryptographic attacks Ciphertext after first permutation: goawoaarnafxngla lggaonyylixa Ciphertext after second permutation: wfglonayagoaaaly grnlanaxoxgi g o a w o a a r n a f x n g l a l g g a o n y y l i x a

20 Using Multiple Keys Is this more secure than C = E(p, k1)?
Important question: Does using multiple keys always make encryption more secure? Brute force attacks Cryptographic attacks Mathematically: C = E(E(p, k1), k2) Is this more secure than C = E(p, k1)?

21 Using Multiple Keys Example: Caesar cipher with 2 keys K1 = 3 K2 = 8
Equivalent to single key K3 = 11 Still only 26 possible mappings from P to C Example: Transposition cipher with 2 keys K1 = K2 = Equivalent to single key K3 = Still only 7! possible mappings from P to C No more secure in either case!

22 Using Multiple Keys Only if:
Using multiple keys greatly increases the number of possible ciphertexts Applying multiple keys is not equivalent to applying a single key No k3 such that E(E(p, k1), k2) = E(p, k3) After applying K1 and K2 Possible ciphertexts Possible ciphertexts After applying K1

23 Avalanche Effect Small change in key  Large change in ciphertext
Desirable property of cipher Knowing some of key  rest of key still hard to find Not a property of substitution ciphers Property of transposition ciphers (particularly if applied multiple times)

24 Avalanche Effect Example: two similar keys applied twice plaintext = longlongagoinagalaxyfaraway k1 = ciphertext = wfglonayagoaaalygrnlanaxoxgi k2 = ciphertext = wfglaalylaoaonrygaangoaxnxgi Already different in 14 of 28 characters

25 Substitution and Transposition
Most modern block ciphers combine substitution and transposition Substitution gives large number of possible keys to defeat brute force attacks Transposition gives avalanche effect to defeat cryptographic attacks

26 Kerckhoff’s Principle
c = E(p, k) If can’t hide k, can we hide the encryption algorithm E? Assumption: Adversary knows algorithm we use All encryption algorithms currently in use are well known! Much easier to conceal/change key than entire algorithm


Download ppt "CSCI 5857: Encoding and Encryption"

Similar presentations


Ads by Google