Bifid Cipher
Polybius-based fractionating cipher (5×5 grid).
Overview
The Bifid cipher tool encrypts and decrypts text by splitting each letter into row and column coordinates on a 5×5 Polybius square, then recombining them in a shuffled order. The result is a classical fractionating cipher that hides simple letter-frequency patterns better than monoalphabetic substitutions.
It is a favourite of cryptogram puzzles, history-of-cryptography courses, and CTF challenges. If you are reconstructing Félix Delastelle's 1901 cipher by hand and want a quick sanity check, or you need to generate worked examples for a classroom, this Bifid cipher solver gives instant feedback.
How it works
A 5×5 grid is filled with a keyword followed by the remaining letters of the alphabet (I and J share a cell). Each plaintext letter is replaced by its (row, column) pair. The tool then writes all rows for the message, followed by all columns, into a single sequence of digits, and finally reads pairs of digits back through the square to produce ciphertext. A period parameter optionally chunks the message into blocks before mixing, which strengthens the cipher.
Decryption reverses the order: reconstruct the digit stream, split it back into rows-half and columns-half, and look each (row, column) pair up in the square.
Examples
Plaintext: FLEEATONCE
Key: PHQGIUMEAYLNOFDXKRCVSTZWB
Output: UAEOLWRINS
Ciphertext: UAEOLWRINS
Key: PHQGIUMEAYLNOFDXKRCVSTZWB
Output: FLEEATONCE
Plaintext: HELLO WORLD
Key: KEYWORD (5x5 square filled with key + rest of alphabet)
Output: (block-mixed ciphertext)
FAQ
Why do I and J share a cell?
A 5×5 grid only fits 25 letters, so one pair has to merge. The convention is I/J, but you will occasionally see Q dropped instead. Both Decryption and encryption follow the same rule.
What is the period for?
Working over the entire message at once leaks structure if the message is long. Splitting into fixed-length blocks (period 5–9 is typical) interleaves the digits in smaller windows, making frequency analysis harder.
Is Bifid secure today?
No. Modern statistical and computer-aided attacks defeat all 5×5 fractionating ciphers in seconds. Use it for fun, not for secrets.
Can the keyword contain duplicates?
The tool deduplicates before building the square — repeated letters in the key are dropped to keep the alphabet contiguous.