1001Ferramentas
🔠Security

Bifid Cipher with Custom Key

Encrypts text with the Bifid cipher using a 5x5 Polybius square built from your keyword, merging I and J and interleaving row and column coordinates.

Cifrado

Bifid: splitting coordinates to scramble everything

Bifid, created by Félix Delastelle in the late nineteenth century, is what happens when someone notices the coordinates of a Polybius square can be handled separately. Each letter becomes a row-column pair; so far that is Polybius. The new idea is writing all the rows in sequence, then all the columns, and only then reading the numbers back two at a time.

Paste the text and the key and the page walks the whole route. The effect of that separation is what makes the cipher interesting: each letter of the result now depends on two letters of the original, one that contributed a row and another that contributed a column. That is genuine diffusion — changing one input letter alters two output letters, in distant positions.

This version treats the whole message as a single block, which in the cipher's terminology is an infinite period. The classic variant splits the text into fixed-size blocks, usually five or seven, and applies the transposition within each. A single block diffuses more, but it requires the whole message to decipher any part — with fixed blocks, a lost fragment does not ruin the rest.

Frequently asked questions

What does the key do here?
It defines how the five-by-five grid is filled: the key letters go in first, with repeats dropped, and the remaining letters follow in alphabetical order. Different grids give different coordinates for the same letter, which is the whole secret of the cipher.
Why does Bifid resist better than Polybius?
Because letter frequency does not survive. In Polybius, each letter always becomes the same pair. In Bifid, the pair that comes out depends on position and on neighbouring letters, so the resulting distribution is much flatter. It is not secure by modern standards, but it needs considerably more elaborate analysis.
Is there a three-dimensional version?
Delastelle himself created Trifid, with a three-by-three-by-three cube giving 27 cells for 26 letters plus a symbol. Each letter becomes three coordinates instead of two, and the mixing gets more thorough still.

Related Tools