Deutsch (DE-CH-AT)English (United Kingdom)
 
 
 
 
 
   


 

PDF Print

Playfair Cipher

 

Background

The Playfair cipher was developed by the Briton Sir Charles Wheatstone (* 6. February 1802; † 19. October 1875).1 The name of the cipher is derived from the name of his friend Baron Lyon Playfair of St. Andrew. Wheatstone and Playfair often met to discuss ideas regarding cryptography.2 Playfair recommended the usage of this cipher for the British military and it has been in use until the end of the World War I.

 

Principle

The first step is to construct a character square (analogous to the Polybius cipher). If the key is "KRYPTOGRAPHIE", then characters occurring double have to be replaced. This results in the new key "KRYPTOGAHIE", which then yields to this key table:

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

The message that should be encoded now has to be split up in pairs of characters. For the message "GEHEIMTEXT" e.g., this results in the pairs: "GE HE IM TE XT".
There are three options if one would want to look up the characters of the respective pairs in the key matrix.

1. Both characters occur in the same line
Both characters are replaced by the two following characters in the line. M and S occur in the same line. M is followed by N and S is followed by L, since it occurs at the end of the line the line is considered wrap-around. MS is therefore encoded by NL. RP is encoded by YT.
2. Both characters occur in the same column
Both characters are replaced by the characters occurring right below them. O and L occur in the same column. O is followed by E and L is followed by U. OL is therefore encoded by EU. RV on the other hand would be encoded by GR.
3. Both characters occur neither in the same line nor in the same column
The first character is replaced by the character that occurs in the same line and in the column in which the second character occurs. Vice versa for the second character. R and Q neither occur in the same line nor in the same column. P occurs in the same line as R and in the same column as Q. P therefore replaces R. M occurs in the same line as Q and in the same column as R and therefore replaces Q, so RQ is encoded by PM. TM would be encoded by RS.

To encode the word "MITTWOCH" e.g., the following pairs of characters would be generated first: "MI TT WO CH". The characters TT occur twice. This is not covered by any of the three cases mentioned above. Characters occurring twice therefore have to be removed. This is done by inserting an X. An additional character is also inserted at the end of the text if the text to be encoded is composed of an unequal number of characters. "MITTWOCH" is therefore split into "MI TX TW OC HA" before the encoding happens. The X divided the doubly occurring characters and the A at the end leads to an even number of characters.3

 

Security

The Playfair cipher can be attacked with a frequency analysis. Counting the frequency of single characters provides no insights into the encoding procedure but counting the frequency of character pairs could. In German for example, the pairs "er" "en" and "ch" occur very often.
For a message like "OTTO", OT would yield XY and TO would yield the inverted sequence YX. This is another insecure property of this cipher.

 

Details

The Playfair cipher belongs to the class of monoalphabetic substitutions. Since pairs of characters are created for this cipher, it also belongs to the class of bigraphic ciphers.

 

Weblinks

http://en.wikipedia.org/wiki/Playfair_cipher

 

References

 

1 o.V.: “Charles Wheatstone”, http://de.wikipedia.org/wiki/Charles_Wheatstone,
2009-02-20
2 Singh, Simon: "Geheime Botschaften", Carl Hanser Verlag, 1999, P. 444
3 Kippenhan, Rudolf: "Verschlüsselte Botschaften", Nikol, 2006, P. 130ff

 

 
   
     
 
 
Copyright © 1998 - 2013 CrypTool Project / Contributors