Playfair Square — Bench tool
Published 14 Sep 2026 ·
Playfair was the first practical cipher to encrypt letter pairs rather than single letters, and that one design decision bought it eighty years of useful service. It was invented by Charles Wheatstone in 1854, championed by Lord Playfair, adopted by the British War Office, and used in the Boer War and the First World War. It is breakable, but it takes a trained analyst hours rather than a bored clerk minutes.
- Era
- Modern
- Type
- Substitution
- Key space
- 25! squares / digraph alphabet
- Level
- Field
IWhat this tool does
Build a 5 x 5 square from a keyword, dropping repeated letters and merging I with J. With the keyword CIPHER:
| C | I | P | H | E |
| R | A | B | D | F |
| G | K | L | M | N |
| O | Q | S | T | U |
| V | W | X | Y | Z |
Now split the plaintext into digraphs: LO OM NE VE RS TO PS. Two letters that land in the same row are each replaced by the letter to their right (wrapping around). Two in the same column are each replaced by the letter below. Two in different rows and columns are each replaced by the letter at the other corner of the rectangle they form.
That third rule is the clever part. It means a single plaintext letter can leave as one of eight different ciphertext letters depending on its partner, and each output letter depends on two input letters at once. Frequency analysis on single letters stops working because there is no longer a stable symbol for any letter.
Repeated pairs like LL are separated by inserting a filler X (LX LX), and a trailing odd letter is padded the same way.
IIThe key
A Playfair square is a permutation of 25 symbols, which suggests 25! = 15,511,210,043,330,985,984,000,000 keys. That figure is misleading in two ways.
First, the keyword construction means real keys come from a much smaller pool: squares actually derived from memorable keywords number in the thousands.
Second, cryptanalysis does not need to find the square. It needs to find the mapping, and Playfair's digraph rules mean the mapping is recoverable from relatively little text. Modern published analyses recover a square from roughly 70 to 120 letters of ciphertext. That is a paragraph.
The practical lesson: the number of keys is not the same as the number of distinguishable keys given the plaintext you can observe.
IIIWhat it will not protect
Historical ciphers are for study and recreation and are not suitable for protecting real information. The full analysis is in the cipher entry.
Read the full entry, with deciphering steps and weakness analysis →