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.
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.
Along the rows is the usual way. Choose the route your puzzle or textbook used.
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
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | Z | E | B | R | A |
| 2 | S | C | D | F | G |
| 3 | H | I | K | L | M |
| 4 | N | O | P | Q | T |
| 5 | U | V | W | X | Y |
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.
| Plain | Number | Key | Key number | Sum | Cipher |
|---|---|---|---|---|---|
| D | 23 | R | 14 | 37 | 37 |
| Y | 55 | U | 51 | 106 | 106 |
| N | 41 | S | 21 | 62 | 62 |
| A | 15 | S | 21 | 36 | 36 |
| M | 35 | I | 32 | 67 | 67 |
| I | 32 | A | 15 | 47 | 47 |
| T | 45 | N | 41 | 86 | 86 |
| E | 12 | R | 14 | 26 | 26 |
| W | 53 | U | 51 | 104 | 104 |
| I | 32 | S | 21 | 53 | 53 |
| N | 41 | S | 21 | 62 | 62 |
| T | 45 | I | 32 | 77 | 77 |
| E | 12 | A | 15 | 27 | 27 |
| R | 14 | N | 41 | 55 | 55 |
| P | 43 | R | 14 | 57 | 57 |
| A | 15 | U | 51 | 66 | 66 |
| L | 34 | S | 21 | 55 | 55 |
| A | 15 | S | 21 | 36 | 36 |
| C | 22 | I | 32 | 54 | 54 |
| E | 12 | A | 15 | 27 | 27 |
How to Use the Nihilist Cipher Tool
- 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. Enter the additive key. This second keyword is numbered from the same square, and its numbers repeat along the message.
- 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. 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:
| Plain | Number | Key letter | Key number | Sum |
|---|---|---|---|---|
| D | 23 | R | 14 | 23 + 14 = 37 |
| Y | 55 | U | 51 | 55 + 51 = 106 |
| N | 41 | S | 21 | 41 + 21 = 62 |
| A | 15 | S | 21 | 15 + 21 = 36 |
| M | 35 | I | 32 | 35 + 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.