The Polybius square is one of the oldest coordinate ciphers, turning each letter into a pair of numbers. This variant stretches the idea into three dimensions: a 3×3×3 cube with 27 cells, one for each of the 26 letters plus a period, so every character becomes an X-Y-Z triplet of single digits.
How it works
The 27 characters fill the cube in order. A character’s index n (0 to 26) is
decomposed like a base-3 number into a layer, row, and column:
z (layer) = floor(n / 9) + 1
y (row) = floor((n mod 9) / 3) + 1
x (column) = (n mod 3) + 1
output = "x y z" (each 1..3)
Decoding reverses the arithmetic: index = (z-1)*9 + (y-1)*3 + (x-1), then the
character at that index is looked up. Because the mapping is a simple bijection,
encode and decode are exact inverses.
Tips and example
The letter A is index 0, giving coordinates 111; B is index 1, giving
211; J is index 9, the first cell of the second layer, giving 112. Encoding
GERA yields four triplets. This makes a neat puzzle format because the output
uses only the digits 1, 2, and 3. Remember it offers no real security — it is a
fixed mapping with no key — so treat it as a learning toy for coordinate
systems and classical ciphers.