170 likes | 445 Views
Introduction to Cryptography. Lecture 8. Polyalphabetic Substitutions. Definition: Let be different substitution ciphers. Then to encrypt the message apply .
E N D
Introduction to Cryptography Lecture 8
Polyalphabetic Substitutions Definition: Let be different substitution ciphers. Then to encrypt the message apply . • If the length of the message is longer than number of different ciphers, then repeat same ciphers in the same order.
Polyalphabetic Substitutions • Example: Let the message be: Today is Tuesday. Let , where is a shift cipher with k=i. The message: UQGEZKUXVGVHBA. • Two same letters encrypted to different letters • Can not use English properties directly
Vigenere Square Example: Let the message be: APRIL SHOWERS BRING MAY FLOWERS. Let the key word be: RHYME. Using the square we encrypt plaintext and get the message: RWPUPJOMIIIZZDMENKMCWSMIIIZ.
Vigenere Cipher • Suppose the key word has n letters. • Let the key letters be • Let the plaintext be • Let the cipher text be • Then
Index of Coincidence • Definition: The index of coincidence, I,is the probability that two randomly selected letters in ciphertext are identical. • Formula: • If I is close to 0.065, then most probably the cipher is monoalphabetic • If I is close to 0.0385, then most probably the cipher is polyalphabetic
Index of Coincidence Example: Let the message be: WSPGMHHEHMCMTGPNROVXWISCQTXHKRVESQTIMMKWBMTKWCSTVLTGOPZXGTQMCXHCXHSMGXWMNIAXPLVYGROWXLILNFJXTJIRIRVEXRTAXWETUSBITJMCKMCOTWSGRHIRGKPVDNIHWOHLDAIVXJVNUSJX.
Index of Coincidence Example: Build a table of letter frequencies (there are 152 letters):
Vigenere Cipher • Vigenere cipher uses a keyword • Let length of the keyword be k • Assume the ciphertext is given • We know message encrypted using Vigenere Cipher • We can find estimated key size using:
Vegenere Cipher Example: For last example with n=152. The keyword may be about 4 letters.
The Kasiski Test • The Kasiski test relies on the occasional coincidental alignment of letter groups in plaintext with the keyword • Find groups of same letters of size 3 or more • Calculate distance between those groups • The greatest common divisor of those distances have a good chance to be the length of the key
The Kasiski Test Example: Let the message be: WCZOUQNAHYYEDBLWOSHMAUCERCELVELXSSUZLQWBSVYXARRMJFIAWFNAHBZOUQNAHULKHGYLWQISTBHWLJCYVEIYWVYJPFNTQQYYIRNPHSHZORWBSVYXARRMJFIAWF. For NAH distances: 48 and 8 For WBSVYXARRMJFIAWF: 72 The keyword can be of size: 2,4 or 8.
Homework • Read pg.107-117. • Exercises: 1(a), 3(c) on pg.118. • Read pg.134-141. • Exercises: 3, 8 on pg.141-143. • Those questions will be a part of your collected homework.