Exhibit 44 of 169 Late 19th Century · ~1902

Two-Square Cipher

Delastelle's simpler sibling of Four-square — two keyed 5×5 squares

Digram frequency · same-row leak

InventorFélix Delastelle (France)
Year~1902
Key TypeTwo keywords (two keyed squares)
Broken ByDigram frequency · same-row leak
Modern LessonBeware of identity transformations as edge cases

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 ACA output-order convention reverses the pair. For independent uniformly distributed positions, a same-row event has probability 1/5; ordinary text need not follow that distribution.

Historical Context

Published alongside the Four-square in Delastelle's 1902 treatise. The "horizontal" variant places the squares side by side; a "vertical" variant stacks them. Horizontal layouts can have a same-row transparency; vertical layouts have a corresponding same-column case. Exact output-order conventions matter. Used recreationally rather than militarily.

How It Works

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 → reverse their order.
Otherwise:
  cipher[0] = right[ row(L), col(R) ]
  cipher[1] = left[ row(R), col(L) ]

ℹ️

Rule and source: The current engine follows the horizontal output order in the American Cryptogram Association specification and worked example. Older museum corpus records used a different transformation; prefix a key with legacy: only when replaying those records. That mode is not the ACA rule.

About this demo: To guarantee that Decrypt exactly restores your original message, this demo reversibly escapes the letters X, Q, and Z (as ZA, ZB, ZC) before enciphering, so padding and filler X can never be confused with a real letter. Messages containing X, Q, or Z therefore produce slightly different ciphertext than a strictly classical two-square cipher would. Odd-length messages are padded with a trailing X.

How It Was Broken
Same-Row Leakage
Complexity: Easy

The same-row case occurs with probability 1/5 under a uniform independent-position model, not necessarily for an English message. Such cases can provide hypotheses from common English digrams (TH, HE, IN, ER) appearing in reverse order in the ciphertext. Those hypotheses still need testing against the rest of the message.

Digram Frequency Analysis
Complexity: Moderate

A fixed two-square mapping can leak digram statistics. Search methods exploit this structure, but success and required sample length depend on the key conventions, plaintext and available evidence.

What It Teaches Modern Cryptography
Concept from Two-Square CipherModern Evolution
Transparent or reversed pairs as cluesA repeated structural feature may supply clues; isolated fixed points alone do not determine security
Two keyed squaresTwo keyed squares are not equivalent to HMAC or a modern two-key security proof
Quick Facts
Exhibit44 of 169
EraLate 19th Century · ~1902
TrustBroken
InventorFélix Delastelle (France)
Year~1902
Key TypeTwo keywords (two keyed squares)
Broken ByDigram frequency · same-row leak
Modern LessonBeware of identity transformations as edge cases
← Previous Playfair Cipher