Skip to main content
CipherChronicle

Cipher methods Polygraphic

Three-square cipher

An intermediate variant between the two-square and four-square ciphers: three 5×5 grids, the middle one standard, two outer ones keyed. Digram encryption by rectangle rule.

Family :
Polygraphic
Difficulty :
Intermediate
Era :
Delastelle family, late 19th — early 20th century

Also known as : Three Square · Three-Squares cipher

The three-square cipher belongs to the Delastelle family of polygraphic grid ciphers. It sits in the middle: stronger than the two-square cipher (too weak against a real cryptanalyst), simpler than the four-square cipher. It’s the perfect didactic step to grasp how multiplying grids increases security.

Principle

Use three 5×5 grids arranged in a triangle or a row, each containing the alphabet (I/J merged):

[ Grid 1 (key K1) ]   [ Grid 2 (standard) ]   [ Grid 3 (key K2) ]
  • Grid 1: filled by writing the key K1 first (e.g. KEYWORD), then the remaining alphabet letters.
  • Grid 2: standard A–Z alphabet (no key).
  • Grid 3: filled by writing the key K2 first (e.g. SECRET), then the remaining letters.

Encryption works on the cleartext by digram:

  1. Read the plain digram (P₁, P₂).
  2. Locate P₁ in grid 2 (standard) and P₂ in grid 3 (keyed K2).
  3. The cipher digram (C₁, C₂) is read off as a rectangle: C₁ is in grid 1 (keyed K1) at row-of-P₁ × column-of-P₂; C₂ is in grid 2 at row-of-P₂ × column-of-P₁.

Decryption reverses the same rectangle rule.

Example

With K1 = KEYWORD, K2 = SECRET, encipher CIPHER CHRON ICLE digram by digram: CI PH ER CH RO NI CL E·. Every pair passes through the three grids by the rectangle rule. The final ciphertext blends the effects of both keys with the standard grid’s position structure.

Strengths and weaknesses

Strengths

  • Two independent keys — keyspace is (26!)² grids, far above the 26! of the two-square cipher.
  • No letter maps to itself within a digram — a structural property of the rectangle rule that guarantees XX never enciphers to XX.
  • No separator needed (unlike Playfair’s X between equal letters in a digram).

Weaknesses

  • Digram frequency analysisTH, HE, IN, ER (English), ES, LE, EN, DE (French) remain statistically detectable with enough material (>500 digrams).
  • Exploitable structure — the rectangle rule pins the standard grid’s letter positions. Once G2 is known, the two outer grids fall via cross-bigram constraints.
  • Sensitive to weak keys — short keys (A, IT) produce nearly-standard grids and the cipher collapses.
  • Two-Square (Delastelle) — two-grid version, simpler, weaker.
  • Four-Square (Delastelle) — four-grid version, more robust — the family standard.
  • Bifid / Trifid (Delastelle) — coordinate fractionation rather than rectangle rule, another structural approach.

How to attack it by hand

  1. Split the ciphertext into digrams and count frequencies.
  2. Identify the most frequent digrams and their plain candidates (TH, HE).
  3. Hypothesize the standard grid G2: its rows/columns constrain the positions of C₁ and C₂.
  4. Once G2 is pinned, attack G1 and G3 by consistency — every known digram gives two simultaneous constraints on the two keyed grids.

The manual attack is serious work: several hours for a 100-digram message, but tractable with patience.

In CipherChronicle

The three-square cipher is a stepping stone toward Four-Square. It teaches the rectangle rule in a frame where one grid is trivial (the standard middle), simplifying visualization. Once the rule is internalized, jumping to the four-square variant is immediate.

Grid

D
L
P
H
G
V
H
C
S
R
M
O
E
N
G
Q
R
S
T
U
V
W
X
Y
Z
KeyK1 = KEYWORD · K2 = SECRET · standard middle grid
  1. 1

    Ciphertext

    Fifteen letters with a distribution close to French/English — digrams are the real unit.

  2. 2

    Pair-wise split

    DL PH GV HC SR MO EN G· — every pair is produced by a triple of grids.

  3. 3

    Hypothesis: 3 grids, 2 of them keyed (KEYWORD, SECRET)

    Two keyed grids flank a standard middle grid. The plain pair enters two grids, the cipher pair leaves the others.

  4. 4

    Reverse via the rectangle rule

    For each cipher digram, find the rectangle that crosses all three grids and read out the plain positions.

  5. 5

    Message revealed

    Cleartext rebuilds digram by digram.