Skip to content
100% local

Nihilist cipher

Encrypt or decrypt text with the Nihilist cipher, a keyed Polybius square plus a numeric key.

Input
Output

Nihilist cipher

The Nihilist cipher is a 19th-century Russian revolutionary cipher that layers two classical ideas: a Polybius square and a running numeric key. Letters first become two-digit row-and-column numbers on a 5×5 grid, then a second keyword — converted through the same grid — is added to each number. The result looks like a string of two- and three-digit numbers rather than letters, harder to crack by eye than a plain substitution cipher.

Paste plain text and pick Encrypt to see it converted; paste space-separated numbers and pick Decrypt to recover the letters. The key does two jobs at once: turn on "Build the grid from the key" to reorder the 5×5 square with that same keyword (the classical setup), or turn it off to use a plain A–Z grid and only add the key numerically. "Keep spaces and punctuation" marks word breaks with a slash and keeps other characters as-is; turning it off drops them entirely, the traditional Nihilist convention for hiding word lengths from an interceptor.

Because the grid has only 25 cells, I and J share one — a decrypted J always comes back as I, as in the original cipher. Without the key, the brute-force option tries every single-letter key and ranks the results by how closely each resembles English text, so a short additive key is often recoverable; longer keywords are outside what a single-letter search can find.

Everything runs locally in your browser — nothing you type or paste is sent anywhere. Copy the result, download it as a .txt file, or send it straight into another tool's input to chain a second transformation.

FAQ

What makes the Nihilist cipher different from a plain Polybius square?
A Polybius square alone just maps letters to number pairs one-to-one. The Nihilist cipher adds a second keyword on top: its letters are converted through the same grid and added to every plaintext number, so the same letter can produce different ciphertext numbers depending on where it falls in the message.
Why do I and J come out the same after decrypting?
The 5×5 grid has 25 cells for 26 letters, so I and J share one, as in the original 19th-century cipher. Any J in the plaintext is encrypted as I and a decrypted message never distinguishes the two.
What does "keep spaces and punctuation" actually change?
With it on, word breaks appear as a slash and other characters (digits, symbols, emoji) are carried through unchanged next to the numbers. With it off, only the letters are encrypted into one continuous run of numbers with no separators — closer to how the cipher was used historically, since omitting breaks hides word lengths.
How does the brute-force option work if I do not know the key?
It tries every possible single-letter key drawn from the current grid — 25 candidates — decrypts your ciphertext with each one, scores the result against typical English letter frequencies, and lists the best matches. It can only find a key that is a single letter; longer keywords are not covered.
Is my text uploaded anywhere?
No. Encryption, decryption and the brute-force search all run entirely in your browser — nothing you type or paste ever leaves your device.