The Trifid cipher, also created by Félix Delastelle around 1902, extends the Bifid idea from two dimensions to three. Letters live in a 3×3×3 cube of 27 cells, and each is split into three coordinates that are mixed across the whole message before being recombined. The extra axis gives stronger diffusion than Bifid. This tool runs the complete algorithm in your browser.
How it works
Lay out 27 symbols — the alphabet A to Z plus one filler symbol (a period) — into a 3×3×3 cube, ordered by a keyword followed by the remaining symbols. Each symbol then has three coordinates: a layer (1–3), a row (1–3) and a column (1–3).
To encrypt, write out all the layer numbers, then all the row numbers, then all the column numbers. Read this combined stream in groups of three, treating each group as a (layer, row, column) address, and look up the symbol at that cell.
Decryption reverses the steps: convert each ciphertext symbol back to its three coordinates, lay the whole sequence out in order, split it into thirds for layers, rows and columns, and combine the three thirds position by position to recover each original symbol.
Example
With a keyword such as FELIX, the text GERATOOLS is converted to layer, row and column streams, those streams are concatenated and re-read in triples, and a scrambled ciphertext results. Decrypting with the same keyword returns GERATOOLS exactly.
Notes
Like Bifid, Trifid can be used periodically by fractionating fixed-length blocks instead of the whole message. This tool fractionates the entire message at once, which gives the maximum diffusion and is the simplest classical form to reason about.