Trifid Cipher
Enter a keyword, a period and a message to encode or decode it with Delastelle's trifid cipher. The tool fills the 3 × 3 × 3 cube, then shows each block's layer, row and column digits, the stream they are read from, and the cipher letters that result. Free, no sign-up, and nothing leaves your browser.
Its letters fill the cube first, each used once; the rest of the alphabet and the extra symbol follow in order, layer by layer.
Symbols per block, each enciphered on its own. Leave empty or 0 to treat the whole message as one block. A period that is not a multiple of 3 mixes the best.
A cube holds 27 symbols, so a 27th joins the 26 letters. Delastelle used +, the American Cryptogram Association uses #. It can be typed in the message like a letter.
Only the 26 letters and the 27th symbol are enciphered. J stays distinct from I. Spaces, digits and other punctuation are dropped, and the result is in capitals.
Cube and blocks
Encoding: write each plain symbol's layer number in one line, its row number beneath and its column number beneath that. Read the digits across — all the layers, then all the rows, then all the columns — and cut them into triples. Each triple is the layer, row and column of a cipher symbol.
Layer 1 of the cube
| 1 | 2 | 3 | |
|---|---|---|---|
| 1 | E | X | T |
| 2 | R | A | O |
| 3 | D | I | N |
Layer 2 of the cube
| 1 | 2 | 3 | |
|---|---|---|---|
| 1 | Y | B | C |
| 2 | F | G | H |
| 3 | J | K | L |
Layer 3 of the cube
| 1 | 2 | 3 | |
|---|---|---|---|
| 1 | M | P | Q |
| 2 | S | U | V |
| 3 | W | Z | # |
A cube is three layers of three rows and three columns, filled layer by layer. Every symbol has three coordinates — layer, row, column — each from 1 to 3.
Block 1
Plain
| Plain | T | R | I | F | I | D | I | S | A | F |
|---|---|---|---|---|---|---|---|---|---|---|
| Layer | 1 | 1 | 1 | 2 | 1 | 1 | 1 | 3 | 1 | 2 |
| Row | 1 | 2 | 3 | 2 | 3 | 3 | 3 | 2 | 2 | 2 |
| Column | 3 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 | 1 |
Cipher
| Triples | 111 | 211 | 131 | 212 | 323 | 332 | 223 | 121 | 212 | 121 |
|---|---|---|---|---|---|---|---|---|---|---|
| Cipher | E | Y | D | B | V | Z | H | R | B | R |
Digits across: 1112111312 1232333222 3121212121
Block 2
Plain
| Plain | R | A | C | T | I | O | N | A | T | I |
|---|---|---|---|---|---|---|---|---|---|---|
| Layer | 1 | 1 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| Row | 2 | 2 | 1 | 1 | 3 | 2 | 3 | 2 | 1 | 3 |
| Column | 1 | 2 | 3 | 3 | 2 | 3 | 3 | 2 | 3 | 2 |
Cipher
| Triples | 112 | 111 | 111 | 122 | 113 | 232 | 131 | 233 | 233 | 232 |
|---|---|---|---|---|---|---|---|---|---|---|
| Cipher | X | E | E | A | T | K | D | L | L | K |
Digits across: 1121111111 2211323213 1233233232
Block 3
Plain
| Plain | O | N | C | I | P | H | E | R |
|---|---|---|---|---|---|---|---|---|
| Layer | 1 | 1 | 2 | 1 | 3 | 2 | 1 | 1 |
| Row | 2 | 3 | 1 | 3 | 1 | 2 | 1 | 2 |
| Column | 3 | 3 | 3 | 2 | 2 | 3 | 1 | 1 |
Cipher
| Triples | 112 | 132 | 112 | 313 | 121 | 233 | 322 | 311 |
|---|---|---|---|---|---|---|---|---|
| Cipher | X | I | X | Q | R | L | U | M |
Digits across: 11213211 23131212 33322311
How to Use the Trifid Cipher Tool
- 1. Enter a keyword. Its letters fill the cube first, each used once, followed by the rest of the alphabet and a 27th symbol.
- 2. Choose the 27th symbol and a period. Delastelle used +; the American Cryptogram Association uses #. The period is the number of symbols enciphered together; leave it empty or 0 to treat the whole message as one block.
- 3. Type the message and choose Encode or Decode. Only the 26 letters and the 27th symbol are enciphered. J stays distinct from I, and spaces and punctuation are dropped.
- 4. Read the working. Each block shows its plain letters, the layer, row and column digits, the digits read across in threes, and the cipher letters.
How the Trifid Cipher Works
The trifid cipher extends the bifid cipher from a square to a cube. Twenty-six letters plus one extra symbol fill a 3 × 3 × 3 cube of three layers, each with three rows and three columns. Every symbol therefore has three coordinates — layer, row and column — each 1, 2 or 3.
To encipher a block, write each plain letter's layer number on one line, its row number beneath, and its column number beneath that. Read the digits across — every layer number, then every row number, then every column number — as one stream, and cut it into groups of three. Each group of three digits names a cipher symbol in the cube. Because the three coordinates of one plain letter end up in three different cipher letters, each cipher letter depends on three plain letters. This mixing is called fractionation. To decode, turn each cipher letter into three digits, lay the stream out again and split it into thirds.
Worked Example
The American Cryptogram Association's example uses the keyword EXTRAORDINARY, the # symbol and a period of 10, so the cube begins E X T / R A O / D I N in layer 1. The first block of TRIFIDSAREFRACTIONATEDCIPHERS is TRIFIDSARE.
| T | R | I | F | I | D | S | A | R | E | |
|---|---|---|---|---|---|---|---|---|---|---|
| Layer | 1 | 1 | 1 | 2 | 1 | 1 | 3 | 1 | 1 | 1 |
| Row | 1 | 2 | 3 | 2 | 3 | 3 | 2 | 2 | 2 | 1 |
| Column | 3 | 1 | 2 | 1 | 2 | 1 | 1 | 2 | 1 | 1 |
Read across, the stream is 111211311112323322213121211211. In threes that is 111, 211, 311, 112, 323, 322, 213, 121, 211, 211, which spell EYMXVUCRYY. The complete message becomes EYMXVUCRYYYYEAYVYOVVXITDPATHE, exactly the cipher text the ACA prints. The last block, EDCIPHERS, has only nine letters, and the same process applies.
Conventions that change the answer
The 27th symbol is a convention too. It takes the last cell after the alphabet, Delastelle's own cube ended with a plus sign, the ACA uses #, and both sides must use the same one. The period matters too: a group size that is not a multiple of 3 is said to mix the coordinates best, and a period of 1 simply returns the plain text. This tool treats J as a separate letter, as published examples of trifid do.
Where the Trifid Cipher Comes From
Félix Delastelle (1840–1902), a French amateur cryptographer, described the trifid cipher in his Traité élémentaire de cryptographie, published in Paris by Gauthier-Villars in 1902, a few months after his death. It followed his bifid cipher and takes the same idea one dimension further: with three coordinates instead of two, each cipher letter carries a share of three plain letters. The American Cryptogram Association still lists it among its standard cipher types and recommends messages of 120 to 150 letters for solving.
How the Trifid Cipher Is Broken
Trifid mixes more widely than bifid, which makes it harder to attack by hand, but it is not safe. An analyst first looks for the period, since the block structure leaves statistical traces, and then searches the 27-symbol cube with a scoring function that rewards English-looking text, which is how puzzle solvers and software crack it from a few hundred letters. With a known plain-text fragment the cube can be pieced together far faster.
A puzzle cipher, not a secure one
Trifid is a good way to learn about fractionation and keyed ciphers. A computer breaks it quickly, so never use it to protect anything private.
Frequently Asked Questions
- What is the trifid cipher?
- The trifid cipher is a fractionating cipher that uses a 3 × 3 × 3 cube of 27 symbols. Each letter becomes three coordinates, the digits are mixed across a block, and each new group of three digits is turned back into a letter. It was invented by the French cryptographer Félix Delastelle.
- How do you decode the trifid cipher?
- Turn each cipher letter into its layer, row and column digits, write the digits as one stream for each block, and split the stream into three equal parts. The first part gives the layers, the second the rows and the third the columns; reading down gives the plain letters. You need the keyword, the 27th symbol and the period.
- Why does the trifid cipher have 27 symbols?
- A 3 × 3 × 3 cube has 27 cells, one more than the 26 letters of the alphabet. The 27th symbol fills the extra cell. Delastelle used a plus sign and the American Cryptogram Association uses #; the choice must match on both sides.
- What is the difference between bifid and trifid?
- Bifid uses a 5 × 5 Polybius square with two coordinates per letter, while trifid uses a 3 × 3 × 3 cube with three. Trifid mixes each letter across three cipher letters instead of two, which spreads the plain text further.
- What period should I use?
- Any block length from 1 upward. A period of 1 leaves the text unchanged, and short periods give little security. Puzzle examples usually use a period of 5 to 15, and a length that is not a multiple of 3 mixes the coordinates best.
- Is the trifid cipher secure?
- No. It hides letter frequencies well by hand-cipher standards, but the block length can be found statistically, and software then recovers the cube from a few hundred letters. It is a historical cipher for learning and puzzles.