StringMash.com

Trifid cipher

The bifid idea in three dimensions. Each letter becomes three digits, and the digits are shuffled between neighbours.

Conversion
26 characters
Updates as you type
Key: felix marie delastelle · Groups of 5

Show the steps
  1. The cube, as three 3x3 layers: layer 1 FEL IXM ARD; layer 2 STB CGH JKN; layer 3 OPQ UVW YZ+. The 27th symbol is +.
  2. Each symbol is three digits: its layer, its row and its column, each 1 to 3.
  3. Split the message into groups of 5 and treat each group on its own.
  4. Write the layers of the group in a line, then the rows, then the columns. Take the digits three at a time and look each triple up in the cube.

Using the trifid tool

The cube key mixes the 27 symbols, and the group size sets how many letters are worked together. Decoding needs both to match. Letters and the + sign are carried, in capitals.

The sample is Wikipedia's example. With the key FELIX MARIE DELASTELLE and groups of 5, it comes out as FMJFV OISSU FTFPU FEQQC.

How it works

The 26 letters and a plus sign make 27 symbols, exactly enough to fill three 3x3 layers. Fill them with the key first, then the rest. Every symbol is now three digits, its layer, its row and its column, each from 1 to 3.

Split the message into groups. In each group, write every letter's three digits in a column under it. Read the digits across, the layers first, then the rows, then the columns, and cut the long line into threes. Each three-digit number is a cipher symbol. Done.

Wikipedia says the group size should not be a multiple of 3, and shows groups of 5 and 7.

Delastelle again

The trifid was invented by Félix Delastelle and described in 1902, in his Traité Élémentaire de Cryptographie. It extends his bifid cipher from a square to a cube.

The sample message, "Aide-toi, le ciel t'aidera", is French, roughly "help yourself and heaven will help you".

Questions

Why is there a + in the cube?

A 3x3x3 cube has 27 cells and the alphabet has 26 letters. Delastelle's example used a plus sign as the 27th symbol.

What is the difference between bifid and trifid?

The bifid splits letters into two digits on a 5x5 square. The trifid splits them into three digits on a 3x3x3 cube, so all 26 letters fit and I and J stay apart.

What group size should I use?

Both sides need the same one. Wikipedia says it should share no factor with 3, so steer clear of 3, 6, 9 and the rest of that times table, and its examples use groups of 5 and 7.

Sources

Added and reviewed . What's new