How to use the bifid cipher tool
- Choose the Direction: Encrypt or Decrypt.
- Enter the Keyword or 25-letter square. The default is a full square used in a classic example.
- Set the Period (0 = whole message), from 0 to 100.
- 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?
Can I type the whole square instead of a keyword?
Why is my output shorter than my message?
Is the bifid cipher secure?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.