Bifid Cipher Encrypt & Decrypt

Combines a Polybius square with fractionation for diffusion.

Free Bifid cipher tool that encrypts and decrypts text using a keyed 5×5 Polybius square and coordinate fractionation. Splits rows and columns then recombines them, all in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does the Bifid cipher work?

Each letter is converted to a row and column on a keyed 5×5 square. All the row numbers are written out first, then all the column numbers. That combined stream is then re-read in pairs, and each pair becomes a new letter on the same square.

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.

Understanding Bifid is easier when you place it among the ciphers it builds on:

CipherKey ideaWeakness
CaesarShift every letter by a fixed amountPure substitution; frequency analysis breaks it in minutes
Polybius squareEach letter becomes a (row, column) coordinate pairCoordinates are substituted but not mixed between positions
BifidPolybius coordinates are pooled across the message and recombinedFractionation introduces diffusion; much harder to break
TrifidExtends the idea to a 3D 3×3×3 cubeEven 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 I might represent J in 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.