Skip to content

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.

Mode

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

123
1EXT
2RAO
3DIN

Layer 2 of the cube

123
1YBC
2FGH
3JKL

Layer 3 of the cube

123
1MPQ
2SUV
3WZ#

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

PlainTRIFIDISAF
Layer1112111312
Row1232333222
Column3121212121

Cipher

Triples111211131212323332223121212121
CipherEYDBVZHRBR

Digits across: 1112111312 1232333222 3121212121

Block 2

Plain

PlainRACTIONATI
Layer1121111111
Row2211323213
Column1233233232

Cipher

Triples112111111122113232131233233232
CipherXEEATKDLLK

Digits across: 1121111111 2211323213 1233233232

Block 3

Plain

PlainONCIPHER
Layer11213211
Row23131212
Column33322311

Cipher

Triples112132112313121233322311
CipherXIXQRLUM

Digits across: 11213211 23131212 33322311

How to Use the Trifid Cipher Tool

  1. 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. 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. 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. 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.

TRIFIDSARE
Layer1112113111
Row1232332221
Column3121211211

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.

Related Tools

More in Codes & Ciphers

See all Codes & Ciphers