The Trifid cipher combines substitution with transposition and fractionation .
It was invented by F�ix Delastelle. Delastelle was a Frenchman who invented
several ciphers including the bifid, trifid, and the four-square ciphers.
Trifid is very similar to Bifid, except that instead of a 5 by 5 keysquare (in bifid) we use a 3 by 3 by 3 key cube.
The Algorithm
Keys for the Trifid cipher usually consist of a 27 letter 'key cube'.
e.g.
Javascript Example of the Trifid Cipher
The keysquare in this example has been written on a single line. To convert to the cube shape,
Plaintext
keysquare =
Period =
Ciphertext
Cryptanalysis
... Coming Soon ...
Code
I have included here some C code that does encryption and decryption of
the Bifid cipher. It is only meant to show the working of the
algorithm, not be a final polished solution.
Bifid_encrypt.c Bifid_decrypt.c
There is also some code that utilises a markov model to automatically
solve a Bifid cipher. Note that very short ciphertexts may
not be cryptanalysed properly. The longer the ciphertext the better, several
hundred characters ideal.
Bifid_crack.c
References
[1] Wikipedia
has a good description of the encryption/decryption process, history
and cryptanalysis of this algorithm
[2] Kahn, D (1973) The CodeBreakers. Macmillan: New York