Trifid cipher
Encrypt or decrypt text with the Trifid cipher, a 3x3x3 coordinate cipher.
Trifid cipher
The Trifid cipher, invented by Félix Delastelle in 1901, is a classical fractionating cipher that takes the idea behind the Bifid cipher one step further. Instead of a flat grid, it arranges 26 letters plus a period into a 3x3x3 cube, so every character maps to a coordinate triple — layer, row and column — instead of a simple row/column pair. Paste your message and this tool builds the cube, converts each letter to its coordinates, and fractionates the result to produce ciphertext that looks nothing like a simple substitution.
The key sets up the cube: its letters fill the first cells in order, and the rest of the alphabet follows, with the period landing wherever it lands. Block length controls how many characters are grouped together before their coordinates are re-paired — the fractionation step that makes Trifid resistant to frequency analysis, since one plaintext letter's coordinates end up mixed with its neighbors'. Direction switches between encrypting and decrypting, and a decrypt with the same key and block length exactly recovers the original message. Non-letter characters can be removed for a clean block of ciphertext or kept in place so spacing and punctuation survive the round trip; grouping the output every N characters is a presentation aid for encrypted text and is skipped on decrypt.
Turn on "Show coordinate grid" to see the three 3x3 layers the cube was built from — useful for checking a key by hand or following along with how the cipher works. The tool handles Windows and Unix line endings, accented letters and emoji: accented Latin letters are folded to their base form before entering the cube, while anything outside the 27-symbol alphabet is either dropped or passed through untouched depending on your setting.
Everything runs locally in your browser — your key and your message are never uploaded or sent anywhere. When you're done, copy the result, download it as a .txt file, or send the output straight back to the input to chain another transformation.