Skip to content

Bifid Cipher

Enter a keyword, a period and a message to encode or decode it with Delastelle's bifid cipher. The tool builds the Polybius square and shows each block's row and column digits, the stream they are read from, and the cipher letters that result. Free, no sign-up, and nothing leaves your browser.

Mode

Its letters (and digits, in the 6 × 6 square) fill the square first, each used once; the rest of the alphabet follows in order. Paste all 25 or 36 characters to type the square out yourself.

Letters per block, each enciphered on its own. Leave empty or 0 to treat the whole message as one block, as Delastelle did.

The square

Along the rows is the usual way. The American Cryptogram Association's example writes it in a clockwise spiral from the top-left corner.

Only letters (and digits, in the 6 × 6 square) are enciphered. Spaces and punctuation are dropped, and the result is in capitals.

I and J share a cell, so every J comes back as I.

Square and blocks

Encoding: write each plain letter's row number in one line and its column number beneath it. Read the digits across — all the rows, then all the columns — and cut them into pairs. Each pair is the row and column of a cipher letter.

12345
1EXTRA
2KLMPO
3HWZQD
4GVUSI
5FCBYN

Rows and columns are numbered from 1.

Block 1

Plain

PlainODDPERI
Row2332114
Column5554145

Cipher

Pairs23321145554145
CipherMWEINGI

Digits across: 2332114 5554145

Block 2

Plain

PlainODSAREP
Row2341112
Column5545414

Cipher

Pairs23411125545414
CipherMGEOYYR

Digits across: 2341112 5545414

Block 3

Plain

PlainOPULAR
Row224211
Column543254

Cipher

Pairs224211543254
CipherLVEYWY

Digits across: 224211 543254

How to Use the Bifid Cipher Tool

  1. 1. Set up the square. Enter a keyword, then choose a 5 × 5 square (with I and J sharing a cell, or with Q left out) or a 6 × 6 square that holds the letters and the digits 0–9. Pick how the keyword is written in.
  2. 2. Choose a period. The period is the number of letters enciphered together. Leave it empty or 0 to treat the whole message as one block.
  3. 3. Type the message and choose Encode or Decode. Only letters (and digits, in the 6 × 6 square) are enciphered; spaces and punctuation are dropped.
  4. 4. Read the working. Each block shows its letters, the row and column digits, the digits read across in pairs, and the cipher letters.

How the Bifid Cipher Works

The bifid cipher combines a Polybius square with a transposition of coordinates. Each plain letter has a row number and a column number in the square. Write the message's row numbers along one line, with the column numbers on a line beneath. Now read the digits across instead of down: all the row numbers first, then all the column numbers, as one stream. Cut the stream into pairs, and each pair names a cipher letter in the same square.

That splits every letter's two coordinates between two different cipher letters, which is where the name comes from (bifid means split in two). Every cipher letter then depends on two different plain letters, the row of one and the column of another. This is called fractionation, and it hides the letter frequencies that give away a simple substitution. To decode, the process is reversed: turn the cipher letters into pairs of digits, split the stream in half, and read the first half as rows and the second as columns.

Worked Example

Encode ATTACK AT DAWN with the keyword BIFID, written along the rows with I and J sharing a cell, and a period of 5. The square starts B I F D A / C E G H K / L M N O P … and the message splits into the blocks ATTAC, KATDA and WN.

BlockRow digitsColumn digitsPairs read acrossCipher
ATTAC144125445114 41 25 44 51DQKTV
KATDA214115544521 41 15 54 45CQAYU
WN532353 23XG

The result is DQKTV CQAYU XG. In the first block the plain A (row 1, column 5) puts its row digit into the first cipher letter, D, and its column digit into the third, K — so one plain letter is spread across two cipher letters. Decoding the cipher text with the same keyword, fill and period returns ATTACKATDAWN.

Conventions that change the answer

Three choices change the cipher text, so match the source you are working from. The square may merge I and J, drop Q, or be 6 × 6. The keyword may be written in along the rows, down the columns or in a spiral; the American Cryptogram Association's bifid example writes EXTRAORDINARY in a clockwise spiral, and Odd periods are popular with period 7 gives MWEINGIMGEOYYRLVEYWY. And the period matters: a period of 1 leaves the text unchanged, and a very short period gives little extra security.

Where the Bifid Cipher Comes From

The bifid cipher is the work of Félix Delastelle (1840–1902), a French amateur cryptographer. He published a version of it in the Revue du Génie civil in 1895 under the name cryptographie nouvelle, and some sources date the cipher's invention to about 1901. He set out bifid, trifid and four-square in the Traité élémentaire de cryptographie, which Gauthier-Villars issued in Paris in 1902, a few months after his death. Bifid was a notable step because it was a practical hand cipher that fractionated letters, an idea later used in ciphers such as ADFGVX.

How the Bifid Cipher Is Broken

Bifid is a short-block cipher, and the block length leaks. Because each cipher letter depends on two plain letters a fixed distance apart, statistics on the pairs of letters in the cipher text show the period, and so do patterns in bigram frequencies. One published method looks at letters half a period apart: with an even period each depends on two plain letters, and with an odd period on three, which is why odd periods are said to be harder to attack this way. Once the period is known, hill-climbing software can search the key square, scoring each guess by how English the decoded text looks. A few hundred letters are enough.

For puzzles, not secrets

Bifid is a good way to learn about fractionation. A computer breaks it quickly, so never use it for anything private.

Frequently Asked Questions

What is the bifid cipher?
The bifid cipher is a fractionating cipher that uses a Polybius square. It writes the message's row numbers and column numbers on two lines, reads the digits across, and turns each new pair of digits back into a letter. It was invented by the French cryptographer Félix Delastelle.
How do you decode the bifid cipher?
Turn each cipher letter into its row and column, write the digits out as one stream, and split the stream in half for each block. The first half gives the rows and the second half the columns, and each row and column pair is a plain letter. You need the keyword, the square convention and the period.
What is the period in a bifid cipher?
The period is the number of letters enciphered together as one block. Longer messages are cut into blocks of that length, and each block is fractionated separately. Typical periods are about 5 to 13, and a period of 0 here means the whole message is one block.
How is bifid different from the Polybius square cipher?
A plain Polybius cipher replaces each letter with its two coordinates, so letter frequencies show through. Bifid takes those coordinates, mixes them across the whole block and converts them back into letters, so every cipher letter depends on two plain letters.
Can the bifid cipher use numbers?
Yes. A 6 × 6 square holds the 26 letters and the digits 0–9, so numbers can be enciphered along with letters. The tool offers this option, and with a 5 × 5 square digits are dropped.
Is the bifid cipher secure?
No. It hides single-letter frequencies, but the period shows up in bigram statistics, and software can then recover the key square from a few hundred letters of cipher text. It is a historical cipher for learning and puzzles.

Related Tools

More in Codes & Ciphers

See all Codes & Ciphers