### 5- POLYGRAM SUBSTITUTION CIPHERS

```Lecture 3
Classical Cipher System
SUBSTITUTION CIPHERS
By:
NOOR DHIA AL- SHAKARCHY
2012-2013
Classical cipher
system
substitution
simple
Homophoni
c
Beal
transposition
polyalphabeti
c
Highorder
Vigene
re
Key
word
mix
shifted
decimatio
n
polygram
affin
Beafort
Variant
beaufort
Hill
Play
Fair
5- POLYGRAM SUBSTITUTION CIPHERS:
PolyGram substitution ciphers are ciphers in which group of
letters are encrypted together, and includes enciphering large
blocks of letters.
• Play Fair:
1- if m1,m2 in same row, then c1, c2 are the two characters to
the right of m1, m2 respectively.
2- If m1, m2 in the same column, then c1, c2 are below the
m1,m2.
3- If m1, m2 are in different rows and columns then c1, c2 are
the other corners of rectangle.
4- If m1=m2 a null character (e.g. x) is inserted in the plaintext
between m1, m2 to eliminate the double.
5- If the plaintext has an odd number of characters a null
character is appended to the end of the plaintext.
5- POLYGRAM SUBSTITUTION CIPHERS:
- Play Fair:
Example:
∑ =A…Z
M = RENAISSANCE
K =
H
A
R
P
S
I
C
O
D
B
E
F
G
K
L
M
N
Q
T
U
V
W
X
Y
Z
M = RE NA IS SA NC EX
Ek(M)= C= HG WC BH HR WF GV
5- POLYGRAM SUBSTITUTION CIPHERS:
Hill Ciphers:
Let d=2 , M= m1 m2, C= c1, c2 where:
C1 =( k11m1 +k12m2) mod n
C2 =(k21m1 +k22m2) mod n
Where
That is :
C1
C2
K=
=
K11
k12
K21
K22
K11
k12
K21
K22
*
Ek(M) = K*M
Dk(C) = K-1 *C mod n
= K-1 K M mod n
=M
Where K.K-1 mod n = I (Identical matrix)
m1
m2
mod n
5- POLYGRAM SUBSTITUTION CIPHERS:
Example:
∑ =A…Z
M = EG
K
K-1
3
2
15
20
3
5
17
9
I
Mod
26
=
M=EG=4 6
C1
C2
=
3
2
3
5
*
4
6
mod 26 =
24
16
Y
=
Q
To decipher:m1
m2
=
15
17
20
9
*
24
16
E
4
mod 26 =
6
=
G
1
0
0
1
```