Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Playfair ciphers

Playfair (KEY)

p l a y
f In a 5x5 matrix, write
i r b c d  the letters of the word
 “playfair” (for
e g h k m example) without
  dups, and fill in with
n o q s t other letters of the
 u v w x z  alphabet, except I,J
used interchangeably.
Playfair encryption
p l a y f 1. Break plaintext into letter pairs
i r b c d  If a pair would contain double letters,

 split with x
Pad end with x

e g h k m  hellothere becomes…

  he lx lo th er ex
n o q s t 

2. For each pair,


 u v w x z  If they are in the same row, replace

each with the letter to its right (mod 5)


he  KG
He lx lo th er ex  If they are in the same column, replace
each with the letter below it (mod 5)
KG YV RV QM GI KU
lo  RV
 Otherwise, replace each with letter
we’d get if we swapped their column
indices
To decrypt, just reverse! lx YV
Playfair encryption
p l a y f 1. Break plaintext into letter pairs
i r b c d  If a pair would contain double letters,

 split with x
Pad end with x

e g h k m  TESTING TOOLS

 
n o q s t
 u v w x z 

Plain text : Te st in gt ox ol sx

Cipher text : NM; TN ; EU ,SV,VR,XY


To decrypt, just reverse!
--; -- ; -- ,--
Playfair encryption
p l a y f Repeat it with two four square cipher by
assuming keywords as Research and
i r b c d  Politics

e g h k m
 
n o q s t
 u v w x z 
Plain text : Testing tools

Cipher text : --; -- ; -- ,

--; -- ; -- ,--

To decrypt, just reverse!


Weaknesses
p l a y f
P is unknown, but structure of
i r b c d 
 its bottom is predictable
P  e g h k m

n o q s t
 Can break using digram
 u v w x z  frequencies
 Example: If a digram and its
reverse both appear often, it’s
He lx lo th er ex probably ER and RE.
 Each plaintext letter maps to
KG YV RV QM GI KU
how many possible ciphertext
letters?
Playfair encryption with 2
squares
p l a y f r,
i r b c d  P.T : TECHNOLOGY
 
e g h k m TE CH NO LO GY
 
n o q s t 
Keys : PLAYFAIR and EXPERT
 u v w x z 
C.T : -- , -- , -- , -- , --

 e x p r t  TE--- in first key table R4C4(t)


a b c d f 

g h i/ j k l  in second key table R1C1(e).
 
m n o q s 
Now make the rectangle for to intersect
 u v w y z  between them and apply different rows
and diff columns.
To decrypt, just reverse!T maps N ; E maps T i.e; TE----NT
cont
p l a y f r,
i r b c d  P.T : TECHNOLOGY
 
e g h k m TE CH NO LO GY
 
n o q s t 
Keys : PLAYFAIR and EXPERT
 u v w x z 
C.T : -- , -- , -- , -- , --

 e x p r t  CH--- in first key table R2C4(t)


a b c d f 

g h i/ j k l  in second key table R3C2(e).
 
m n o q s 
Now make the rectangle for to intersect
 u v w y z  between them and apply different rows
and diff columns.
To decrypt, just reverse! C maps R ; H maps K i.e; CH----RK
cont
p l a y f r,
i r b c d  P.T : TECHNOLOGY
 
e g h k m TE CH NO LO GY
 
n o q s t 
Keys : PLAYFAIR and EXPERT
 u v w x z 
C.T : -- , -- , -- , -- , --

 e x p r t  NO-- in first key table R4C1(n)


a b c d f 

g h i/ j k l  in second key table R4C3(o).
 
m n o q s 
Now make the rectangle for to intersect
 u v w y z  between them and apply different rows
and diff columns.
To decrypt, just reverse! N maps Q ; O maps M i.e; NO----QM
cont
p l a y f r,
i r b c d  P.T : TECHNOLOGY
 
e g h k m TE CH NO LO GY
 
n o q s t 
Keys : PLAYFAIR and EXPERT
 u v w x z 
C.T : -- , -- , -- , -- , --

 e x p r t  LO-- in first key table R1C2(l)


a b c d f 

g h i/ j k l  in second key table R4C3(o).
 
m n o q s 
Now make the rectangle for to intersect
 u v w y z  between them and apply different rows
and diff columns.
To decrypt, just reverse! L maps A; O maps N i.e; LO----AN
cont
p l a y f r,
i r b c d  P.T : TECHNOLOGY
 
e g h k m TE CH NO LO GY
 
n o q s t 
Keys : PLAYFAIR and EXPERT
 u v w x z 
C.T : -- , -- , -- , -- , --

 e x p r t  GY-- in first key table R3C2(g)


a b c d f 

g h i/ j k l  in second key table R5C4(y).
 
m n o q s 
Now make the rectangle for to intersect
 u v w y z  between them and apply different rows
and diff columns.
To decrypt, just reverse! G maps K; Y maps V i.e; GY----KV

You might also like