Two-Square Cipher
Delastelle's simpler sibling of Four-square — two keyed 5×5 squares
Why This Matters
A pared-down version of the Four-square: only two keyed squares, side by side. Slightly easier to use by hand but with a glaring weakness — when a digram's two letters happen to lie in the same row of their respective squares, the cipher leaves them unchanged. Roughly 20% of digrams pass through unencrypted.
Published alongside the Four-square in Delastelle's 1902 treatise. The "horizontal" variant places the squares side by side; a "vertical" variant stacks them. Both share the same-row leak. Used recreationally rather than militarily.
Arrange two keyed 5×5 squares horizontally. For each digram, look up the first letter in the left square and the second in the right square. Read the ciphertext from the opposite corners of the rectangle they form.
If the two letters share a row → leave them unchanged. Otherwise: cipher[0] = left[ row(L), col(R) ] cipher[1] = right[ row(R), col(L) ]
Roughly one in five digrams passes through the cipher unchanged. An attacker can identify these by noticing common English digrams (TH, HE, IN, ER) appearing as themselves in the ciphertext. From there, the rows are partially recovered.
As with Four-square, the cipher is a fixed digram-to-digram substitution. Digram frequency tables and simulated annealing recover both keys with a few hundred characters of ciphertext.
| Concept from Two-Square Cipher | Modern Evolution |
|---|---|
| Identity transformations as weakness | Modern designs eliminate fixed points (e.g., AES S-box has no fixed point) |
| Two-key fractionation | Twin-key constructions appear in HMAC and double-encryption |
| Exhibit | 42 of 49 |
| Era | Late 19th Century · ~1902 |
| Security | Weak |
| Inventor | Félix Delastelle (France) |
| Year | ~1902 |
| Key Type | Two keywords (two keyed squares) |
| Broken By | Digram frequency · same-row leak |
| Modern Lesson | Beware of identity transformations as edge cases |