2. Playfair Cipher
• First practical digraph substitution cipher.
• Invented by Charles Wheatstone in 1854
• Named after Lord Playfair
• Used for tactical purposes by British
Forces in Second Boer War an in World
War I and for the same purpose by
the Australians during World War II
3. Encryption Algorithm Steps
• Generate the Key Square (5x5)
– The key square is a 5x5 grid of alphabets that
acts as the key for encrypting the plaintext.
– One letter is omitted from the table (letter J)
– The initial alphabets in the key square are the
unique alphabets of the key in the
order in which they appear followed
by the remaining letters of the
alphabet in order.
4. Encryption Algorithm Steps
• Algorithm to encrypt the plain text
– The plaintext is split into pairs of two letters.
– If there is an odd number of letters, a Q is
added to the last letter.
5. Rules for Encryption
• If both the letters are in the same column:
– Take the letter below each one (going back to
the top if at the bottom)
• If both the letters are in the same row:
– Take the letter to the right of each one (going
back to the leftmost if at the rightmost
position)
6. Rules for Encryption
• If neither of the above rules is true:
– Form a rectangle with the two letters and take
the letters on the horizontal opposite corner of
the rectangle.
8. K E Y W O
B D A B C
F G H I/J L
M N P Q S
T U V X Z
P: WH YD ON TY OU
C: YI EA ES VK EZ
P: CO ME TO TH EW IN DO WQ
C: LC NK ZK VF YO GQ CE BX
9. Practice
1. If key = “computer”, write the playfair cipher key matrix
2. Solve using playfair cipher key: “primrose”, plaintext is
“hike the foothills.”
3. For the given PT = CRYPTOGRAPHY and key is
SECURITY find the cipher text using playfair.
4. If key = “colgate”, write the playfair cipher key matrix.
5. Find cipher text using Playfair cipher for given
PT = UNIVERSITY
key = HELLO