●●●●● ●●●● ●●0 Use in Cryptanalysis ●●● ●●●● o key concept-monoalphabetic substitution ciphers do not change relative letter frequencies o discovered by Arabian scientists in gth century o calculate letter frequencies for ciphertext o compare counts/plots against known values o for monoalphabetic must identify each letter o tables of common double/triple letters help COMP4690. HKBU
COMP4690, HKBU 16 Use in Cryptanalysis ⚫ key concept - monoalphabetic substitution ciphers do not change relative letter frequencies ⚫ discovered by Arabian scientists in 9th century ⚫ calculate letter frequencies for ciphertext ⚫ compare counts/plots against known values ⚫ for monoalphabetic must identify each letter ⚫ tables of common double/triple letters help
●●●●● ●●●● ●●0 Example Cryptanalysis ●●● ●●●● given ciphertext UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUF POMBZWPFUPZHMDJUDTMOHMQ count relative letter frequencies ●P:13.33%,z:11.67%,S:8.33%,U:8.33%,O:7.5%,M:6.67%,etc · guess P& Z are e and t It's helpful to look at frequency of two-letter combinations. The most common is th ● guess Zw is th proceeding with trial and error finally get it was disclosed yesterday that several informal but direct contacts have been made with political representatives of the viet cong in moscow COMP4690. HKBU
COMP4690, HKBU 17 Example Cryptanalysis ⚫ given ciphertext: UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ ⚫ count relative letter frequencies ⚫ P: 13.33%, Z: 11.67%, S: 8.33%, U: 8.33%, O: 7.5%, M: 6.67%, etc. ⚫ guess P & Z are e and t ⚫ It’s helpful to look at frequency of two-letter combinations. The most common is “th”. ⚫ guess ZW is th ⚫ proceeding with trial and error finally get: it was disclosed yesterday that several informal but direct contacts have been made with political representatives of the viet cong in moscow
●●●●● ●●●● ●●0 Playfair Cipher ●●● ●●●● the large number of keys in a monoalphabetic cipher cannot provide enough security o one approach of improving security is to encrypt multiple letters of plaintext o the playfair cipher is an example invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair o another approach is polyalphabetic substitution cipher COMP4690. HKBU
COMP4690, HKBU 18 Playfair Cipher ⚫ the large number of keys in a monoalphabetic cipher cannot provide enough security ⚫ one approach of improving security is to encrypt multiple letters of plaintext ⚫ the Playfair Cipher is an example ⚫ invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair ⚫ another approach is polyalphabetic substitution cipher
●●●●● ●●●● ●●0 Playfair Key Matrix ●●● ●●●● ●a5X5matrⅸ k of letters based on a keyword First, fill in letters of keyword (sans duplicates) Second. fill rest of matrix with other letters e I and j count as one letter E.g., using the keyword MONARCHY MO NAR C H Y B D EFG工R L P Q ST U V X Z COMP4690. HKBU
COMP4690, HKBU 19 Playfair Key Matrix ⚫ a 5x5 matrix of letters based on a keyword ⚫ First, fill in letters of keyword (sans duplicates) ⚫ Second, fill rest of matrix with other letters ⚫ I and J count as one letter ⚫ E.g., using the keyword MONARCHY M O N A R C H Y B D E F G I K L P Q S T U V W X Z
●●●●● ●●●● ●●0 Encrypting ●●● ●●●● plaintext encrypted two letters at a time 1. if a pair is a repeated letter, insert a filler like 'x,e.g balloon "encrypts as"ba lx lo on 2. if both letters fall in the same row, replace each with letter to right ( wrapping back to start from end), e.g,"ar encrypts as " rm 3. if both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom), eg mu" encrypts to"cm 4. otherwise, each letter is replaced by the one that lies in its row and the column of the other plaintext letter, e. g hs"encrypts to"bp, and"ea"to"im COMP4690. HKBU
COMP4690, HKBU 20 Encrypting ⚫ plaintext encrypted two letters at a time: 1. if a pair is a repeated letter, insert a filler like ‘x', e.g., "balloon" encrypts as "ba lx lo on" 2. if both letters fall in the same row, replace each with letter to right (wrapping back to start from end), e.g., "ar" encrypts as "rm" 3. if both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom), eg. "mu" encrypts to "cm" 4. otherwise, each letter is replaced by the one that lies in its row and the column of the other plaintext letter, e.g., "hs" encrypts to "bp", and "ea" to " im