The Bifid cipher, invented by Félix Delastelle around 1901, strengthens the Polybius square by adding fractionation. Instead of substituting letters directly, it splits each letter into its row and column coordinates, mixes those coordinates across the whole message, and then recombines them into new letters. This diffusion is what makes Bifid harder to break than the squares it is built from. This tool runs the full algorithm in your browser.
How it works
Build a keyed 5×5 square from a keyword followed by the rest of the alphabet, with I and J sharing a cell. Convert each plaintext letter to its row and column number on that square.
Now fractionate: write all the row numbers in order, then append all the column numbers. Read this combined number stream in pairs, treating each pair as a (row, column) coordinate, and look up the letter at that cell. The result is the ciphertext.
Decryption reverses the steps: turn each ciphertext letter back into a pair of numbers, lay the full stream out as a single sequence, split it into a first half (the rows) and a second half (the columns), and pair the two halves position by position to recover each plaintext letter.
Example
Using a keyword such as KEYWORD, the word GERATOOLS is first converted to coordinates, the rows and columns are concatenated, and the stream is re-read in pairs to produce a scrambled ciphertext. Decrypting with the same keyword restores GERATOOLS exactly.
Notes
This implementation fractionates over the entire message (no fixed period), which is the simplest classic form. A periodic variant breaks the text into blocks of a set length and fractionates each block separately, trading some diffusion for easier hand operation.
Comparing Bifid to related ciphers
Understanding Bifid is easier when you place it among the ciphers it builds on:
| Cipher | Key idea | Weakness |
|---|---|---|
| Caesar | Shift every letter by a fixed amount | Pure substitution; frequency analysis breaks it in minutes |
| Polybius square | Each letter becomes a (row, column) coordinate pair | Coordinates are substituted but not mixed between positions |
| Bifid | Polybius coordinates are pooled across the message and recombined | Fractionation introduces diffusion; much harder to break |
| Trifid | Extends the idea to a 3D 3×3×3 cube | Even more diffusion per letter |
The key insight Delastelle added is that fractionation makes each output letter depend on two different input letters’ coordinates, so substituting one plaintext letter affects multiple ciphertext positions. This is the same goal modern ciphers pursue with the confusion and diffusion principles.
Practical notes for puzzles
- The I/J merger is a genuine source of ambiguity when decrypting: a decrypted
Imight representJin the original word. Context usually resolves this in English, but in foreign-language text it can cause real confusion. - Non-alphabetic characters — digits, spaces, punctuation — are typically dropped before encryption (the exact treatment depends on the implementation). This means a cipher challenge may present ciphertext as a continuous letter string even if the original had spaces.
- The keyword should not repeat letters; duplicate letters are removed left-to-right when building the square.
- To break Bifid without the key, the standard attack guesses the key using hill climbing or simulated annealing against a fitness function (for example, quadgram statistics). Without the key, there is no shortcut analogous to frequency analysis of a simple substitution cipher.