Bifid cipher — split letters into coordinates and mix them

The bifid cipher writes each letter as a row and a column in a 5×5 square, lists all the rows then all the columns, and reads the mixed numbers back as letters; use a keyword or a full 25-letter square, with an optional period.

Live demo · real result from this tool
Direction

Result

UAEOLWRINS

Processed on your device — nothing is uploaded.

How to use the bifid cipher tool

  1. Choose the Direction: Encrypt or Decrypt.
  2. Enter the Keyword or 25-letter square. The default is a full square used in a classic example.
  3. Set the Period (0 = whole message), from 0 to 100.
  4. Type into Your text and copy the Result.

What it does and when to use it

Félix Delastelle, a French cryptographer, devised the bifid cipher around 1900. It mixes two simple ideas: a substitution, via the coordinates of the Polybius square, and a transposition, by separating the row numbers from the column numbers. Each ciphertext letter ends up depending on two different plain letters, so single-letter frequency counts are much less useful to an attacker than with a simple substitution.

It is used today in puzzle hunts, capture-the-flag challenges and cryptography courses. It does not protect real data. Compare it with the four-square cipher and the Playfair cipher, which also work with 5×5 squares, or with the columnar transposition cipher for transposition on its own.

How it works

The default square:

B G W K Z
Q P N D S
I O A X E
F C L U M
T H Y V R

Encrypting FLEEATONCE. Write each letter’s row and column under it:

Letter:  F L E E A T O N C E
Row:     4 4 3 3 3 5 3 2 4 3
Column:  1 3 5 5 3 1 2 3 2 5

Now read all the rows, then all the columns, as one line: 4433353243 1355312325. Take the digits in pairs as (row, column): 44 is U, 33 is A, 35 is E, 32 is O, 43 is L, and so on, giving UAEOLWRINS.

Decrypting turns each cipher letter into its two digits, splits the line in half, uses the first half as rows and the second half as columns, and reads the letters back. With a period, the same steps run on each block separately. Letters are taken in capitals with J as I, and everything else is removed first. The tool runs in your browser.

Worked examples

Results from the tool:

Flee at once      default square              →  UAEOLWRINS
Flee at once      default square, period 5    →  UAIEYYDINS
Meet me at noon   keyword secret              →  HSHAQQWGWTEA
HSHAQQWGWTEA      keyword secret, Decrypt     →  MEETMEATNOON

The first two lines differ only in the period. With period 5, FLEEA and TONCE are mixed as two separate blocks, so most of the output changes even though the message and square are the same.

Limits and tips

  • Short periods are easier to attack, because each block mixes fewer letters. Whatever you choose, write it down with the key.
  • A single mistyped cipher letter spoils up to two plain letters in its block when decrypting, so check the ciphertext carefully.
  • Word breaks are lost. The reader has to split MEETMEATNOON back into words.

Frequently asked questions

What is the period?
The period splits the message into blocks of that many letters, and each block is mixed on its own. With 0, the whole message is one block. A period of 5 changes FLEEATONCE from UAEOLWRINS to UAIEYYDINS. Sender and reader must use the same period.
Can I type the whole square instead of a keyword?
Yes. The key box takes either. A keyword fills the square with its letters first and the rest of the alphabet after, repeats skipped. A full 25-letter string, such as the default BGWKZQPNDSIOAXEFCLUMTHYVR, is used exactly as written, row by row. J always counts as I.
Why is my output shorter than my message?
Spaces, digits, punctuation and accented letters are removed, because the square has only the 25 letters A to Z without J. The output is one block of capitals.
Is the bifid cipher secure?
No. It was a clever hand cipher in its day because each output letter depends on two input letters, but modern methods break it readily. Use it for puzzles and learning.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close