Cryptanalysis: Nihilist Cipher

Notes on cracking Nihilist and Vignere ciphers by hand


What is a Nihilist cipher?

Recently for a challenge site I cracked a classical Nihilist cipher. These ciphers use an alphabet written into a 5 x 5 block. Addresses of each letter are used for the cipher, such as 11, 45, etc. Any order can be used, with no repetition. The alphabet usually starts with a keyword.

  1 2 3 4 5
1 E X A M P
2 L B C D F
3 G H I J K
4 N O Q R S
5 T U V W Y

A key is chosen, say obfuscate, which is coded using the addresses: 42 22 25 52 45 23 13 51 11. Then, the plain text is coded: LEAVE AT SUNDOWN becomes 21 11 13 53 11 13 51 45 52 41 24 42 54 41 (no spaces).

To generate the cipher text, the code of the key is added to the corresponding position in the text. The key is repeated as necessary. So, the cipher text for the above example is 63 33 38 105 56 36 64 96 63 83 46 67 106 86.

Vulnerabilities

To crack the cipher text turned out to be a lot of fun. I was provided the plain text for the first 15 characters or so, which made it a bit easier to generate the alphabet block. Some of the things I noticed on the way:

Surprisingly, I didn't program a solver, but went with the pen and paper approach. The solution had a nine-letter key. I suppose longer keys would make for easier cracking, but I'm not sure.

The Nihilist cipher, by the way, is a close relative of the Vigenere cipher, which does very much the same thing only using letters and a larger alphabet block.

Happy solving!