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.
Tracing a short example
Take the keyword KEY and the two-letter message HI. After placing K, E, Y then A, B, C … (skipping K, E, Y already used) into the 3×3×3 cube, suppose H sits at layer 1, row 2, column 3 and I at layer 2, row 1, column 1.
The coordinate streams are:
Layers: 1 2
Rows: 2 1
Columns: 3 1
Concatenated: 1 2 2 1 3 1. Read in triples: (1,2,2) and (1,3,1). Look up each address in the cube to get two ciphertext symbols. Decrypting with the same keyword reverses the process exactly.
The more letters in the message, the more each position influences positions far from itself — which is the whole point.
Trifid vs Bifid vs Polybius
| Feature | Polybius | Bifid | Trifid |
|---|---|---|---|
| Grid size | 5×5 | 5×5 | 3×3×3 |
| Symbols | 25 (I=J) | 25 (I=J) | 27 (A–Z + .) |
| Coordinates per letter | 2 | 2 | 3 |
| Diffusion | None | Each letter spreads over the message | Stronger — three streams interleaved |
| Inventor | Ancient Greek | Félix Delastelle | Félix Delastelle |
The third axis is what makes Trifid harder to break than Bifid: each plaintext letter influences three separate streams rather than two, so changing one letter scrambles more of the ciphertext.
Practical notes
- Keyword quality matters. Longer, more random keywords reduce the chance of an attacker guessing the cube layout. Avoid short dictionary words.
- Periodic mode. Trifid can be run in blocks (for example 5 letters at a time) rather than across the whole message. This tool fractionates the entire message for maximum diffusion.
- Historical security. Trifid is a classical cipher from the early 1900s and is breakable with modern cryptanalytic techniques. Use it for educational exploration or puzzles, not to protect real data.
- The period filler. The 27th cell uses
.(period) by default. Some implementations use a digit or leave it unassigned — the convention varies.