CS 701
SK Hafizul Islam
hafi786@gmail.com
Department of CSE
IIIT Kalyani
10 July 2018 CS 701 1
Symmetric Encryption
• Conventional / private-key / single-key
• Sender and recipient share a common key
• All classical encryption algorithms are private-key
• Was only type prior to invention of public-key in 1970’s
128 2128 = 3.4 1038 2127 µs = 5.4 1024 years 5.4 1018 years
168 2168 = 3.7 1050 2167 µs = 5.9 1036 years 5.9 1030 years
26 characters 26! = 4 1026 2 1026 µs = 6.4 1012 years 6.4 106 years
(permutation)
18
10 July 2018 CS 701
Example of Caesar Cipher...
Use the additive cipher with key = 15 to decrypt the
message “WTAAD”.
Solution:
We apply the decryption algorithm to the plaintext
character by character:
19
10 July 2018 CS 701
Cryptanalysis of Caesar Cipher
• only have 26 possible ciphers
– A maps to A,B,..Z
• could simply try each in turn
• a brute force search
• given ciphertext, just try all shifts of letters
• do need to recognize when have plaintext
• eg. break ciphertext "GCUA VQ DTGCM"
21
10 July 2018 CS 701
Language Redundancy and Cryptanalysis
• human languages are redundant
• letters are not equally commonly used
• in English E is by far the most common letter
– followed by T, R, N, I, O, A, S
• other letters like Z, J, K, Q, X are fairly rare
• have tables of single, double & triple letter frequencies
for various languages
https://www.tandfonline.com/doi/abs/10.1080/0161-117991854133
26
10 July 2018 CS 701
Example of Multiplicative Cipher
What is the key domain for any multiplicative cipher?
Solution
The key needs to be in Z26*. This set has only 12 members: 1, 3, 5, 7,
9, 11, 15, 17, 19, 21, 23, 25.
27
10 July 2018 CS 701
Affine Cipher
28
10 July 2018 CS 701
Example of Affine Cipher
The affine cipher uses a pair of keys (k1, k2) in which the
first key is from Z26* and the second is from Z26. The size of
the key domain is (26 × 12) = 312.
29
10 July 2018 CS 701
Example of Affine Cipher…
Use the affine cipher to decrypt the message “ZEBBW” with
the key pair (7, 2) in modulus 26.
Solution
31
10 July 2018 CS 701
Frequency analysis of Affine Cipher…
32
10 July 2018 CS 701
Frequency analysis of Affine Cipher…
• There are only 57 characters of ciphertext.
• The most frequent ciphertext characters are: R(8 times), D(7
times), E, H, K (5 times) and F, S, V (4 times).
• First guess, R is the encryption of e and D is the encryption of t,
since e and t are most common letters.
• We have EK(4)=17 and EK(19)=3. Thus, 4K1+K2=17 and 19K1+K2=3
33
10 July 2018 CS 701
Frequency analysis of Affine Cipher…
• Unique solution of 4K1+K2=17 and 19K1+K2=3 is K1=6, K2=19. Since
gcd(K1, 26)=2>1. So the hypothesis is incorrect.
• Second guess, R is the encryption of e and E is the encryption of t.
• We have EK(4)=17 and EK(19)=4. Thus, 4K1+K2=17 and 19K1+K2=4
• It leads K1=13, Since gcd(K1, 26)=2>1. So the hypothesis is
incorrect.
34
10 July 2018 CS 701
Frequency analysis of Affine Cipher…
• Third guess, R is the encryption of e and H is the encryption of t.
• We have EK(4)=17 and EK(19)=7. Thus, 4K1+K2=17 and 19K1+K2=7
• It leads K1=8, Since gcd(K1, 26)=2>1. So the hypothesis is incorrect.
35
10 July 2018 CS 701
Frequency analysis of Affine Cipher…
• Continuing, we suppose that, R is the encryption of e and K is the
encryption of t.
• We have EK(4)=17 and EK(19)=10. Thus, 4K1+K2=17 and 19K1+K2=10
• It leads K1=3, K2=5, Since gcd(K1, 26)=1.
• The key K = (3, 5) gives a meaningful plaintext: “algorithms are
quite general definitions of arithmetic processes”
36
10 July 2018 CS 701
Thank You