Four-Square Cipher
NewEncrypt and decrypt letter pairs with the Four-Square cipher, a digraph substitution cipher using four 5x5 grids and two independent keywords.
The Four-Square cipher (invented by Félix Delastelle in 1901) encrypts letter pairs using four 5x5 grids: two unshifted plain-alphabet squares (top-left and bottom-right) and two independently keyed cipher squares (top-right and bottom-left, built from Key 1 and Key 2). Each plaintext pair is located in the plain squares, and the ciphertext pair is read from the corresponding row/column intersections in the two keyed squares. Like other Polybius-family ciphers, I and J share a single cell.
Frequently Asked Questions
How is the Four-Square cipher different from Playfair?
Both encrypt letter pairs using 5x5 grids, but Playfair uses a single keyed grid with geometric row/column swap rules, while Four-Square uses four separate grids — two unshifted plain-alphabet squares and two independently keyed squares — making it generally considered more resistant to frequency analysis.
Why does the tool need two separate keywords?
Each keyword builds one of the two keyed 5x5 grids (traditionally shown in the top-right and bottom-left corners of the four-square layout) — using two different keywords instead of one is exactly what gives this cipher its extra layer of security compared to single-key digraph ciphers.
Who invented the Four-Square cipher?
Félix Delastelle, a French cryptographer, published it in 1901 — the same era and inventor behind the related Bifid and Trifid ciphers, all of which build on the earlier Polybius square concept.
What happens to my message if it has an odd number of letters?
Since the cipher processes two letters at a time, an odd-length message is automatically padded with a trailing "X" before encryption, the standard convention for digraph ciphers.
Why do I and J share a cell in this cipher too?
Like the Polybius square, Playfair, and Bifid ciphers, a 5x5 grid only has 25 cells for 26 letters, so I and J are conventionally merged — any J in your input is automatically treated as an I.