Skip to content
Cipherloom密码织机

CIPHER/SUBSTITUTION/POLYBIUS SQUARE

Polybius Square

Published 20 Sep 2026 · · 6 min read

Polybius did not invent a cipher. He invented a notation: a way to write any letter as two numbers between one and five. That notation turned out to be the most reused idea in the history of cryptography, and every cipher in this collection that converts letters to digits is standing on it.

Era
Antiquity
Type
Substitution
Key space
25! (any grid arrangement)
Level
Starter
Cipher loom plate: Polybius Square
plate polybius-square · Substitution

IPhenomenon

Fill a 5 x 5 grid with the alphabet, merging I and J into one cell because 26 letters do not fit into 25 cells:

12345
1ABCDE
2FGHIK
3LMNOP
4QRSTU
5VWXYZ

Now LOOM becomes 31 34 34 32. A message turned into a string of digits can be sent as torch flashes at night, written on a wall, tapped out, or hidden inside a longer number.

The cost is visible immediately: the output has a very strong signature. Odd digits only, and always pairs. Anyone who sees a long run of digits from 1 to 5 knows exactly what they are looking at.

PlainDigitsNote
L31row 3, column 1
O34row 3, column 4
M32row 3, column 2

Note what the digit form buys you: the size of the symbol set has dropped from 26 to 5. Five distinguishable signals is a much easier engineering problem than twenty-six, and that is the whole reason the notation exists.

IIKey space

If you may arrange the 25 symbols in the grid any way you like, the key space is 25! — the same enormous number that appears for Playfair, with the same caveat: real users pick a keyword to build the grid, which collapses the space to a few thousand arrangements at most.

But the more useful way to think about the Polybius square is that the grid is not the point. The point is the reduction of an alphabet to a small coordinate system, and coordinate systems compose.

Two digits of 5 values = 25 symbols. Three digits = 125. Add a sixth row and you get 36 symbols, which is exactly how ADFGVX later carried the ten digits and the alphabet together in one grid.

IIIEnciphering

  • Draw a 5 x 5 grid. Number the rows and columns 1 to 5.
  • Fill it with the alphabet, merging I and J. Optionally write a keyword first and then the unused letters.
  • Write the plaintext in capitals and remove spaces.
  • For each letter, find its row number and column number.
  • Write the row number first, then the column number. L sits in row 3, column 1, so it becomes 31.
  • Join all the pairs into one continuous string of digits, or keep them in groups of five pairs for readability.

IVDeciphering

  • Reconstruct the identical grid — this is the shared secret, and it must match exactly.
  • Split the digit string into pairs. If the string has an odd number of digits, something has been lost in transmission.
  • For each pair, read the first digit as the row and the second as the column.
  • Read off the letter at that intersection.
  • Resolve I/J ambiguities from context. Names and technical terms are where this bites.

VWeakness

The digit signature is unmistakable. A run of paired digits in the range 1-5 identifies the cipher before any analysis begins. Adding 1 to every digit, or using a keyword grid, hides the content but not the structure.

It is still a monoalphabetic substitution. Every letter has exactly one code, so letter frequencies survive perfectly. Counting the 25 possible pairs takes minutes.

The I/J merge creates ambiguity. The receiver cannot tell whether 24 meant I or J and must resolve it from context. In practice, most European languages can absorb this; in transcription of names and places it produces errors.

It composes badly with itself. Enciphering an already-encoded message produces a string that looks like a grid address for a different grid, which sounds like an advantage and is actually a fast route to confusion and to key-reuse mistakes.

VIPractice

Ciphertext

32 35 35 33 34 15 52 15 43 44 45 35 41 44

Hint: Unmodified A-Z grid, I and J merged. Read row then column.

Reveal the answer

Plaintext

LOOM NEVER STOPS

This entry is historical and educational. It is not guidance for circumventing the security of any system in use today, and it is not professional advice.

·History note

Polybius of Megalopolis, a Greek historian of the second century BC, described the grid in his Histories as a system for signalling. He proposed two sets of five torches, held up in pairs, so that a sender on one hill could transmit any letter to a receiver on another. The cryptographic use came later; the signalling use was the original purpose, and it explains the design constraint that shapes everything downstream: five is a number a human being can hold up in the dark.

·Further reading

The Polybius square is the ancestor of every fractionating cipher: a cipher that splits each plaintext letter into pieces, scrambles the pieces, and reassembles them into different letters. Bifid and ADFGVX, both later on this loom, are exactly this.

Fractionation is powerful because it destroys the one-to-one relationship between plaintext letters and ciphertext letters without giving up the convenience of a small symbol set.

Next on the loom: tironian-notes — the other ancient answer to the same problem, which reduced the symbol set by abbreviating whole words instead of individual letters.

+Weave into