L2 Classical Encryp
L2 Classical Encryp
Introduction
• Substitution Ciphers
• Transposition Ciphers
A B C J K L
D E F
M N O
G H I
P Q R
T U X Y
V Z
A C G W
V D X D X D G
X X D V G A X
G X D V D A V
G D X V D D X
X A D X X V G
V A D G X V D
Affine: example
• a = 3, b = 7
• Find the equations for encryption and
decryption.
• Encrypt the message “the dog”
• Decrypt the message “TIVUJWL”
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
College of Engineering, Pune
Monoalphabetic Cipher Security
• now have a total of 26! =~ 4 x 10^26 keys
• so many keys! must be secure against
ciphertext cryptanalysis!
K P C
25
19
Decryption
P= K-1 x C MOD 26
College of Engineering, Pune
Playfair Cipher
• not even the large number of keys in a
monoalphabetic cipher provides security
• one approach to improving security was to
encrypt multiple letters
• the Playfair Cipher is an example
• invented by Charles Wheatstone in 1854,
but named after his friend Baron Playfair
Wireless wi re le sx sz VK YR KR RU YU
Monday mo nd ay IT QA FS
H E L L O → message
7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message
+ 23 (X) 12 (M) 2 (C) 10 (K) 11 (L) key
= 30 16 13 21 25 message + key
= 4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z) message + key (mod 26)
E Q N V Z → ciphertext
If we have one more bit to make it a 3-bit binary number, the number of possible states
also doubles to eight, as follows:
000
001
010
011
100
101
110
111
In general, if an n bit binary number has k possible states, an n+1 bit binary number will
have 2k possible states.
00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 01 00 00 00 00 00 00 00 01
… …
FF FF FF FF FF FF FF FF FF FF FF FF FF
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
…
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF