Playfair Cipher
Playfair Cipher
In this scheme, pairs of letters are encrypted, instead of single letters as in the case
of simple substitution cipher.
In playfair cipher, initially a key table is created.
The key table is a 5×5 grid of alphabets that acts as the key for encrypting the
plaintext. Each of the 25 alphabets must be unique and one letter of the alphabet
(usually J) is omitted from the table as we need only 25 alphabets instead of 26.
If the plaintext contains J, then it is replaced by I.
The sender and the receiver deicide on a particular key,
Key= ‘tutorials’
We convert this key ‘Tutorials’ into 5*5 matrix
● In a key table, the first characters (going left to right) in the table is the
phrase, excluding the duplicate letters.
● The rest of the table will be filled with the remaining letters of the alphabet,
in natural order. The key table works out to be –
T U O R I
A L S B C
‘H’ and ‘I’ are in same column, hence take letter below
D E F G H
them to replace. HI → QC
K M N P Q
V W X Y Z
2nd Rule:
If both letters are in the same row, take the letter to the right of each one
(going back to the left if at the farthest right)
T U O R I
A L S B C
‘D’ and ‘E’ are in same row, hence take letter to the right
D E F G H
of them to replace. DE → EF
K M N P Q
V W X Y Z
Rule 3
If neither of the preceding two rules are true, form a rectangle with the two
letters and take the letters on the horizontal opposite corner of the rectangle.
KEY=DECEPTIVE
DECPT
IVABF
GHKLM
NOQRS
TUWXY
C.T= PK NW TN BQ VO GN GV SD OV QM ZY
PK NW TN BQ VO GN GV SD OV QM ZU