Skip to content

Nihilist Cipher

Enter a square keyword, an additive key and a message to encode it with the Nihilist substitution cipher, or paste numbers to decode them. The tool shows the 5 × 5 square and, for every letter, its number, the key number added to it and the total. Free, no sign-up, and nothing leaves your browser.

Mode

Its letters fill the 5 × 5 square first, each used once; the rest of the alphabet follows in order.

A second keyword. Its letters are numbered from the same square, and the numbers repeat along the message.

Fitting 26 letters into 25 cells

Along the rows is the usual way. Choose the route your puzzle or textbook used.

Totals of 100 and over

Row and column numbers add up to between 22 and 110. Both ways of writing the totals above 99 are in use, and decoding needs the same one.

Only letters are enciphered. Spaces, digits and punctuation in the message are dropped, and decoded text is in capitals. Cipher numbers are separated by spaces.

I and J share a cell, so every J comes back as I.

Square and sums

Encoding: replace each plain letter by its number and each key letter by its number, then add them. The key repeats along the message.

Key square

12345
1ZEBRA
2SCDFG
3HIKLM
4NOPQT
5UVWXY

Each letter's number is its row, then its column: S in row 1, column 1 is 11. Rows and columns are numbered from 1.

PlainNumberKeyKey numberSumCipher
D23R143737
Y55U51106106
N41S216262
A15S213636
M35I326767
I32A154747
T45N418686
E12R142626
W53U51104104
I32S215353
N41S216262
T45I327777
E12A152727
R14N415555
P43R145757
A15U516666
L34S215555
A15S213636
C22I325454
E12A152727

How to Use the Nihilist Cipher Tool

  1. 1. Build the square. Enter a keyword for the 5 × 5 Polybius square and choose whether I and J share a cell or Q is left out. The rest of the alphabet follows the keyword.
  2. 2. Enter the additive key. This second keyword is numbered from the same square, and its numbers repeat along the message.
  3. 3. Choose how totals above 99 are written. Write them in full, as in 106, or drop the hundreds, as in 06. Decoding must use the same setting.
  4. 4. Type the message and choose Encode, or paste cipher numbers and choose Decode. The working table shows each letter's number, the key number and the sum.

How the Nihilist Cipher Works

The Nihilist cipher is a numeric substitution cipher. A 5 × 5 Polybius square gives every letter a two-digit number: its row, then its column, each from 1 to 5, so the numbers run from 11 to 55. The additive key's letters are numbered the same way and repeat along the message. Each cipher number is the plain letter's number plus the key letter's number, by ordinary addition, so the totals run from 22 to 110. To decode, subtract the key number; the result is a row and column that name the plain letter.

Worked Example

Wikipedia's example builds the square from the keyword ZEBRAS (written along the rows, with I and J sharing a cell), so Z is 11, E is 12, B is 13 and so on, and uses the additive key RUSSIAN. Encode DYNAMITE WINTER PALACE:

PlainNumberKey letterKey numberSum
D23R1423 + 14 = 37
Y55U5155 + 51 = 106
N41S2141 + 21 = 62
A15S2115 + 21 = 36
M35I3235 + 32 = 67

The full message becomes 37 106 62 36 67 47 86 26 104 53 62 77 27 55 57 66 55 36 54 27. The American Cryptogram Association's version differs in one detail: it writes the totals 100 to 110 as 00 to 10, so that every cipher number has two digits. With its square keyword SIMPLE and key EASY, The early bird becomes 65 55 32 75 43 65 26 08 44 34 54 79, and the 08 is really 108. The tool offers both conventions.

Where the Nihilist Cipher Comes From

The cipher is named after the Russian Nihilists, revolutionaries who used it in the 1880s to organise against the tsarist regime. Soviet spy rings later built stronger descendants on the same idea, using a straddling checkerboard to turn text into digits and adding a long key without carrying, and the VIC cipher of the 1950s was the most developed of them.

How the Nihilist Cipher Is Broken

Because each letter becomes one number, with no mixing between letters, the basic Nihilist cipher is a numeric Vigenère cipher and falls to the same attacks: find the key length from repeated patterns, then treat each position as a simple shift. Ordinary addition makes it worse, because it leaks. With a 5 × 5 square, a total above 100 can only come from a plain letter and a key letter that are both in row 5, so every such number narrows the possibilities. It is a classic puzzle cipher, not a secure one.

For puzzles and history, not secrets

The Nihilist cipher is easy to learn and easy to break. Use it for puzzles and teaching, never for anything private.

Frequently Asked Questions

What is the Nihilist cipher?
The Nihilist cipher is a substitution cipher that turns each letter into a two-digit row-and-column number from a Polybius square, then adds a number taken from a repeating key. It was used by Russian revolutionaries called Nihilists in the 1880s.
How do you decode a Nihilist cipher?
Subtract each key number from the matching cipher number, using the same square and key. The difference is a two-digit number whose first digit is a row and whose second digit is a column, and that cell holds the plain letter. If the totals above 99 had their hundreds dropped, add 100 back to any number below 22 first.
Why are some Nihilist cipher numbers three digits long?
Row and column numbers add up to as much as 55 + 55 = 110, so totals of 100 or more are possible. Some sources write them in full, such as 106, and the American Cryptogram Association writes 100 to 110 as 00 to 10. Choose the convention your puzzle uses.
How is the Nihilist cipher different from the Vigenère cipher?
Vigenère adds letters modulo 26. Nihilist numbers each letter from a Polybius square and adds the numbers as ordinary integers, with no wrap-around. The structure is otherwise similar, which is why Vigenère-style attacks work on it.
What are the two keywords for?
The first keyword mixes the Polybius square, so the same letter does not always get the same number. The second keyword, the additive key, is numbered from that square and added to the message. Both are needed to decode.
Is the Nihilist cipher secure?
No. A repeating additive key is attacked the same way as a Vigenère key, and ordinary addition leaks information, because a total above 100 can only come from two row-5 letters. It is a historical cipher for puzzles and learning.

Related Tools

More in Codes & Ciphers

See all Codes & Ciphers