History and Background Part 4: Transposition Ciphers CSCI 5857: Encoding and Encryption
Outline Transposition ciphers Attacks on transposition ciphers Effectiveness of using multiple keys Avalanche effect as a goal of encryption
Transposition Cipher Ciphertext = Permutation of plaintext Permutation = integers from 1 to n rearranged n = number of characters in block of text Example: A permutation of size 7 might be 1357246 That permutation is the transposition key K
Transposition Algorithm Assign each plaintext character a number based on position Move each plaintext character into ciphertext position given by permutation Mathematically ci = pK[i] Simple example: Plaintext: runaway Permutation: 1357246 Ciphertext: rnwyuaa
Column Transposition Ciphers Break plaintext into columns Example plaintext: longlongagoinagalaxyfaraway Key: 5241763 (size n of key = 7 columns) 5241763 longlon gagoina galaxyf arawayx Break plaintext into rows of size n of key Insert extra chars to fill columns (padding)
Column Transposition Example 5 2 4 1 7 6 3 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 second, and so on This column first
Column Transposition Decryption Divide ciphertext into n strings Arrange strings into columns, with order of columns determined by key goawoaarnafxnglalggaonyylixa 5 2 4 1 7 6 3 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
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
Multiple 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 5 2 4 1 7 6 3 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
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)?
Multiple Keys Examples 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 = 5241763 K2 = 7325641 Equivalent to single key K3 = 6357142 Still only 7! possible mappings from P to C No more secure in either case!
Multiple Key Effectiveness 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) Possible ciphertexts After applying K1 and K2 After applying K1
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)
Avalanche Effect in Transposition Example: two similar keys applied twice plaintext = longlongagoinagalaxyfaraway k1 = 5241763 ciphertext = wfglonayagoaaalygrnlanaxoxgi k2 = 5421763 ciphertext = wfglaalylaoaonrygaangoaxnxgi Already different in 14 of 28 characters
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
What’s Next Let me know if you have any questions Begin work on Assignment 1: History and Background