<<Up     Contents

Playfair cipher

The Playfair cipher is a manual symmetric encryption technique invented in 1854 by Charles Wheatstone for telegraph secrecy and was the first literal digraph substitution cipher. It was used by British forces in the Boer War and World War I and also by the Australians during World War II. It is named after Wheatstone's friend Lyon Playfair who popularized it. The technique encrypts pairs of letters (digraphs), instead of single letters as in the simple Substitution cipher and Vigènere cipher systems then in use (making it significantly harder to crack).

The usual form of the cipher used a 5 by 5 table and a key word or phrase. Memorization of the key and 4 simple rules was all that was required to create the 5 by 5 table and use the cipher.

First you filled the spaces in the table with the letters of the key (dropping any duplicate letters), then filled the remaining spaces with the rest of the letters of the alphabet in order (usually omitting "Q" to reduce the alphabet to fit, other versions put both "I" and "J" in the same space).

Then you applied the following 4 rules to each pair of letters to encrypt your message:

To decrypt just use the inverse of these 4 rules (dropping any extra "X"s when you finish, that don't make sense in the final message).

Example

Using a key of "playfair example" the table becomes:

 P L A Y F
 I R E X M
 B C D G H
 J K N O S
 T U V W Z

Encrypting the message "Hide the gold in the tree stump":

 HI DE TH EG OL DI NT HE TR EX ES TU MP
                             ^

  1. The pair HI forms a rectangle, replace it with BM
  2. The pair DE is in a column, replace it with ND
  3. The pair TH forms a rectangle, replace it with ZB
  4. The pair EG forms a rectangle, replace it with XD
  5. The pair OL forms a rectangle, replace it with KY
  6. The pair DI forms a rectangle, replace it with BE
  7. The pair NT forms a rectangle, replace it with JV
  8. The pair HE forms a rectangle, replace it with DM
  9. The pair TR forms a rectangle, replace it with UI
  10. The pair EX (X inserted to split EE) is in a row, replace it with XM
  11. The pair ES forms a rectangle, replace it with MN
  12. The pair TU is in a row, replace it with UV
  13. The pair MP forms a rectangle, replace it with IF

 BM ND ZB XD KY BE JV DM UI XM MN UV IF

Thus the message "Hide the gold in the tree stump" becomes "BMNDZBXDKYBEJVDMUIXMMNUVIF".

Like most pre-modern ciphers, the playfair cipher can be easily cracked. Obtaining the key is trivial if both plaintext and ciphertext are known. When only the ciphertext is known, cryptanalysis of the cipher involves searching through the key space for matches between the frequence of occurrence of digrams (pairs of alphabets) and the known frequency of occurrence of digrams in the English language.

External Link

wikipedia.org dumped 2003-03-17 with terodump