Bifid cipher
Encrypt or decrypt text with the Bifid cipher, combining a Polybius square with transposition.
Bifid cipher
The Bifid cipher, invented by Félix Delastelle around 1901, is a classical cipher that combines a Polybius square with transposition, which is why it resists simple frequency analysis far better than a plain substitution cipher. Each letter of the plaintext first becomes a row-column coordinate pair on the square; the coordinates from a whole block of letters are then written out row-digits-first and column-digits-second, and re-paired to produce new coordinates, which are converted back into letters through the same square. This tool runs the whole process, in either direction, entirely in your browser.
The keyword option seeds the square: its letters (deduplicated) fill the first cells, and the rest of the alphabet follows in order, so the same keyword always rebuilds the same grid. Choose a 5×5 square, which merges I and J into one cell as in the original cipher, or a 6×6 square, which keeps I and J separate and adds the ten digits so numbers can be enciphered too. The transposition period controls how many letters are mixed together at a time — a period of 1 leaves the text unchanged, while longer periods spread each letter's influence across more of the ciphertext. Characters outside the grid's alphabet, such as spaces and punctuation, can be removed entirely or kept in place at their original position; grouping the output into fixed-width blocks and choosing upper or lower case are purely cosmetic.
Turn on "Show square and intermediate steps" to see the grid that was built and, block by block, the coordinates before and after transposition — useful for checking a hand calculation or understanding how the cipher actually scrambles a message. The direction option lets you flip between encrypting and decrypting with the same keyword and settings.
Everything runs locally: your keyword and text are processed in your browser and never uploaded anywhere. When you are done, copy the result, download it as a .txt file, or send it straight into another tool to chain a second transformation.