Nihilist Cipher Encoder, Decoder & Key Finder

The Nihilist cipher turns every letter into a Polybius square coordinate, then adds the coordinate of a repeating key letter. Enter a square keyword and a key, and the tool shows the square and the letter-by-letter sum behind every ciphertext number.

Quick examples

Ciphertext

37 106 62 36 67 47 86 26 104 53 62 77 27 55 57 66 55 36 54 27

2 characters that are not letters were skipped. J is treated as I.

Fills the square first; leave empty for a plain alphabet square.

Its letters become coordinates that are added, in a repeating loop.

Polybius square

12345
1ZEBRA
2SCDFG
3HI/JKLM
4NOPQT
5UVWXY

Coordinate 23 means row 2, column 3.

  • Plaintext letter
  • Key letter
  • Keyword letter

Addition table

Each plaintext coordinate plus the matching key coordinate gives one ciphertext number.

The Nihilist cipher turns letters into numbers with a keyword Polybius square, then adds a second key to those numbers. The ciphertext is a row of two- and three-digit numbers such as 58 66 58 87 59. This Nihilist cipher tool builds the square from your keyword, shows every addition in a table you can click through, decrypts with the key, and can even find the key when you only have the numbers and the square.

What is the Nihilist cipher?

The Nihilist cipher combines two older ideas. A Polybius square turns each letter into a two-digit coordinate, and a repeating key, as in the Vigenère cipher, is added on top. The result is a polyalphabetic cipher written in numbers instead of letters.

Nihilist cipher
KeysA square keyword and an additive key
Plaintext letters25 (I and J share a cell)
CiphertextNumbers from 22 to 110, separated by spaces
FamilyPolybius square + Vigenère-style key addition
OriginRussian revolutionary groups, 1880s
Security todayWeak; it can be broken without either key

How to use this Nihilist cipher tool

  1. Pick a mode. Encrypt turns text into numbers, Decrypt turns numbers back into text with the key, and Find key recovers a lost additive key.
  2. Enter the square keyword. The 5×5 square on the right updates as you type: the keyword letters come first, then the rest of the alphabet. Leave it empty to use the plain alphabet.
  3. Enter the key. Any word works. Its letters are turned into numbers with the same square and repeated along the message.
  4. Type the message or paste the numbers. Spaces, commas and line breaks between numbers are all fine.
  5. Read the table. Every letter gets a row: plaintext letter and number, key letter and number, and their sum (or difference when decrypting). Tap a row to highlight both letters in the square.
  6. Change the options only if you need to. Coordinate order switches between row-column and column-row numbering, and the mod 100 switch handles a variant described below.

The three example buttons above the tool load a short encryption, a decryption, and a longer message for the key-finding mode.

How the Nihilist cipher works

Encrypting by hand takes four steps. We will encrypt MEET AT NOON with the square keyword NIHIL and the key FROST.

Step 1: Build the keyword square

Write the keyword into a 5×5 grid without repeating letters (NIHIL becomes N, I, H, L), then fill in the rest of the alphabet in order, leaving out J. Rows and columns are numbered 1 to 5.

12345
1NIHLA
2BCDEF
3GKMOP
4QRSTU
5VWXYZ

Step 2: Turn the message into numbers

Each letter becomes its row number followed by its column number. M is in row 3, column 3, so it becomes 33. MEETATNOON becomes 33 24 24 44 15 44 11 34 34 11.

Step 3: Turn the key into numbers and repeat it

The key uses the same square: F = 25, R = 42, O = 34, S = 43, T = 44. Repeat it until it is as long as the message: 25 42 34 43 44 25 42 34 43 44.

Step 4: Add the two rows

LetterMEETATNOON
Plain33242444154411343411
Key25423443442542344344
Sum58665887596953687755

The Nihilist ciphertext is 58 66 58 87 59 69 53 68 77 55. Notice that the two E's became two different numbers, 66 and 58, while two different letters, M and the second E, both became 58. The same letter no longer always gives the same number, which is what makes the cipher stronger than a plain Polybius square.

How to decrypt a Nihilist cipher

Decryption is subtraction. Build the same square, turn the key into numbers, repeat it, and subtract it from each ciphertext number. The result must be a valid square coordinate, two digits from 1 to 5; look that coordinate up in the square.

Cipher5866588759
Key2542344344
Difference3324244415
LetterMEETA

If a difference is not a valid coordinate, such as 60 or 17, something is wrong: the key, the square, the coordinate order, or a mistyped number. The tool marks that number and keeps decoding the rest, so one typo does not hide the whole message.

Why some Nihilist numbers have three digits

The largest coordinate is 55. When a 55 meets a key number of 55, the sum is 110, so a Nihilist ciphertext can contain three-digit numbers. Most descriptions of the cipher simply write them as they are. That is why the numbers in a Nihilist message must be separated by spaces: without them, 1105 could be 110 and 5, or 11 and 05.

Some puzzle sources use a mod 100 variant instead: they drop the hundreds digit, so 110 becomes 10 and 104 becomes 04, and every number has exactly two digits. Decrypting then adds 100 back whenever the subtraction goes below zero. Both versions decode correctly as long as the sender and the reader use the same one. Turn on the mod 100 switch for the variant. With it on, the tool can also split a long run of digits without spaces into pairs.

Row-column or column-row?

Most sources write the row number first, so the top-right corner of the square is 15. A few write the column first, which makes the same cell 51. If decryption produces only invalid coordinates, switch the coordinate order before suspecting the key.

Common mistakes when working a Nihilist cipher by hand

  • Forgetting that J is I. The square has 25 cells, so J is written as I in both the message and the key. A key such as JADE becomes IADE.
  • Repeating letters in the square. Each letter goes into the square only once. Writing the keyword NIHIL with both I's shifts every later letter by one cell.
  • Restarting the key at each word. The key runs continuously along the letters of the message and ignores spaces. It does not start again with every new word.
  • Carrying into the wrong digit. When adding 47 + 45 by hand, the answer is 92, not 82. Writing the sums in a table, as the tool does, makes slips like this easy to spot.
  • Mixing up the two keys. The square keyword decides where letters sit; the additive key decides what is added. Swapping them produces valid-looking numbers that decrypt to nonsense.

How to crack the Nihilist cipher without the key

The Nihilist cipher leaks its key through the digits of its numbers. Every plaintext coordinate and every key coordinate has two digits between 1 and 5, so:

  • The last digit of each ciphertext number is the sum of two digits from 1 to 5, which is between 2 and 10. A number ending in 2 means both last digits were 1; a number ending in 0 means both were 5.
  • The first digit works the same way, plus any carry. A ciphertext number of 22 can only come from 11 + 11, and 110 only from 55 + 55.

Each ciphertext number therefore rules out most possible key numbers for its position. The Find key mode uses this in two stages.

  1. Find the key length. For every possible length from 1 to 20, the numbers are split into columns, one for each key position. For each column the tool keeps only the key numbers that turn every number in that column into a valid coordinate. A wrong length soon leaves some column with no candidates at all.
  2. Choose the key letters. For the right length, each column usually has one to four candidates left. The tool tries the combinations and ranks the decrypted texts by how much they look like English.

For example, encrypting the 72-letter message MEET AT NOON BY THE NORTH GATE AND BRING THE MAP OF THE OLD MINE SHAFT WE FOUND LAST WINTER with the NIHIL square and the key FROST gives 72 numbers. In the tool, every key length from 1 to 20 is ruled out except 5 and its multiples 10, 15 and 20. At length 5 the five positions keep the candidates E or F, R, E or O, M or S, and O or T. Of those 16 possible keys, FROST is the one that produces readable English, and the whole message decrypts.

Short messages are harder. The ten numbers of MEET AT NOON give each key position only two numbers to test, and the first position still has eight possible key numbers. As a rule, the longer the message, the more certain the result. This method needs the square. If the square is unknown too, the key still shows up the same way, but the letters behind the coordinates have to be worked out like a simple substitution cipher.

How to recognize a Nihilist ciphertext

  • Numbers between 22 and 110, mostly two digits, sometimes three.
  • No number ends in 1, because the last digits always add up to at least 2. A list of numbers containing 31 or 41 is not a standard Nihilist cipher.
  • Numbers are written with spaces between them.
  • Compared with a plain Polybius cipher, the numbers are larger and include digits 6 to 9 and 0, which a Polybius square never produces.

History of the Nihilist cipher

Illustration of a lamp-lit attic table in 1880s St. Petersburg with a hand-drawn 5 by 5 grid and a strip of two-digit cipher numbers
An artist's impression of Nihilist cipher work: a 5×5 Polybius square drawn in pencil, and the resulting numbers written out on a strip of paper.

The cipher takes its name from the Russian Nihilists, revolutionary groups of the 1870s and 1880s that opposed the tsarist government and used it to keep their correspondence secret. Combining a Polybius square with a numeric key was easy to do with pencil and paper and much harder to read than either method on its own.

The same idea, turning letters into numbers and then adding a numeric key, reappeared in later Soviet hand ciphers. The best known is the VIC cipher of the 1950s, which converted letters with a straddling checkerboard before adding numeric keys. To see how the Polybius square led to several of these ciphers, read Polybius square descendants: Nihilist, Bifid and ADFGX.

CipherLetters becomeKeySame letter always gives the same output?
Polybius squareTwo-digit coordinatesSquare keyword (optional)Yes
Nihilist cipherCoordinates plus a key numberSquare keyword and additive keyNo, it depends on the key letter
Vigenère cipherLetters shifted by a key letterKeywordNo, it depends on the key letter

In effect, the Nihilist cipher is a Vigenère cipher carried out on Polybius numbers. It inherits the Vigenère weakness of a short repeating key, and adds a new one of its own: the limited digits of the square tell an attacker which key numbers are possible.

Frequently Asked Questions About the Nihilist Cipher

Can I decrypt a Nihilist cipher without the key?

Often, yes, if you know the square keyword and the message is long enough. Choose Find key: the tool tests every key length from 1 to 20, keeps only key numbers that turn every ciphertext number into a valid square coordinate, and ranks the remaining keys by how English the result looks. Messages of 50 numbers or more usually give a clear answer.

Why does my Nihilist ciphertext contain 110 or other three-digit numbers?

Square coordinates go up to 55, so adding a key number can give up to 110. Three-digit numbers are normal in the standard Nihilist cipher. Some sources drop the hundreds digit instead; use the mod 100 switch to match them.

Why do I get invalid coordinates when decrypting?

Check, in this order: the square keyword, the key, the coordinate order (row-column or column-row), and the mod 100 setting. If only one or two numbers are invalid, look for a typo in those numbers; the tool marks their positions.

What is the difference between the Nihilist cipher and the Polybius square?

The Polybius square turns each letter into the same two-digit coordinate every time. The Nihilist cipher adds a repeating key to those coordinates, so the same letter gives different numbers at different positions, and the numbers range from 22 to 110 instead of 11 to 55.

Why are I and J combined in the Nihilist square?

A 5×5 square has 25 cells and the English alphabet has 26 letters, so two letters must share a cell. I and J are the usual pair because J is rare and was historically a variant of I. Write J as I in both the message and the key.

How can I tell if a list of numbers is a Nihilist cipher?

Look for numbers between 22 and 110, separated by spaces, with no number ending in 1. A plain Polybius cipher only uses the digits 1 to 5; a Nihilist cipher also produces 6 to 9 and 0.

Similar tools