How the Four-Square cipher works
Four 5Γ5 squares sit in a 2Γ2 block. The top-left and bottom-right squares hold the ordinary alphabet. The top-right and bottom-left squares are each built from a keyword: its letters first, each once, then the rest of the alphabet.
- Drop spaces and punctuation and split the message into pairs, adding an X if one letter is left over.
- Find the first letter of the pair in the top-left plain square and the second letter in the bottom-right plain square.
- They mark opposite corners of a rectangle. The first cipher letter is in the top-right square, on the first letter's row and the second letter's column. The second cipher letter is in the bottom-left square, on the second letter's row and the first letter's column.
To decrypt, find the cipher pair in the two keyed squares and read the other corners from the plain squares.
Example
Keywords EXAMPLE (top right) and KEYWORD (bottom left), Q left out: HELP ME OBI WAN KENOBI becomes FY GM KY HO BX MF KK KI MD.
How to break it
- Pair frequencies. Each plaintext pair always gives the same cipher pair, so TH, HE and IN show up as the most common cipher pairs. You need a few hundred letters for the counts to mean much.
- Known words. The first letter of each cipher pair depends only on the first plain letter's row and the second plain letter's column, so a guessed word fills in the keyed squares row by row.
- Computer search. Hill climbing on the two keyed squares, scored by how English the output looks, breaks a few hundred letters quickly.
History
The French cryptographer FΓ©lix Delastelle (1840β1902) described Four-Square, along with Bifid and Trifid, in his book on cryptography published in 1902, the year he died.
Related tools
- Playfair cipher: one square, three rules
- Two-Square cipher: two keyed squares only
- Bifid cipher and Trifid cipher: Delastelle's other inventions