Lec Three
Lec Three
Dani Mfungo
Outlines
• Caesar Cipher
• Monoalphabetic Ciphers
• Playfair Cipher
• Hill Cipher
Caesar Cipher
Brute-Force Cryptanalysis
• Simply try all the 25 possible keys:
• Assumptions:
• The encryption and decryptions
algorithms are known
• There are only 25 keys to try
• The language of the plaintext is known
and easily recognizable
Brute-Force
Cryptanalysis
of
Caesar Cipher
Letters frequencies
obtained for comparison
Plain text
obtained
Monoalphabetic ciphers Cont…
For example
“MONARCHY”
is a keyword
(by load peter Wimsey)
2. Two plaintext letters that fall in the same row of the matrix are each replaced
by the letter to the right, with the first element of the row circularly following
the last. For example, ar is encrypted as RM.
3. Two plaintext letters that fall in the same column are each replaced by the
letter beneath, with the top element of the column circularly following the
last. For example, mu is encrypted as CM.
4. Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its
own row and the column occupied by the other plaintext letter. Thus, hs
becomes BP and ea becomes IM (or JM, as the encipherer wishes).
Hill Cipher
• Developed by the mathematician Lester Hill
in 1929.
• It is based on modulo arithmetic and matrix
Example of Hill Cipher (ENCRYPTION)
Steps
• Find the Determinant of K
• Use the Det K to find the K-1
Finding the K-Inverse
4,1
(1) K (2) det K (4 x 2) (3x1) 5
3,2
1
1 2, 1
(3) K 1
det K
mod 26 (4) 5 mod 26 21
3, 4
1 2, 1 42,21 16,5
(5) K 21 mod 26 mod 26
3, 4 62, 84 15,6
Decrypting C=[HV] = [8,22]
16,5 8 238 4
(6) P 15,6 22 mod 26 252 mod 26 18
P [DR ]
Assignment