Nihilist Cipher Encoder & Decoder

Russian nihilist's Polybius-based additive numerical cipher

Free Nihilist cipher tool — encodes text with a keyed Polybius square then adds a repeating keyword's digit pairs to each number. Encrypt and decrypt in your browser, no upload, round-trip verified. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What two keys does the Nihilist cipher use?

It uses a keyword to scramble the 5×5 Polybius square and a second additive keyword. The square turns letters into two-digit coordinates, and the additive keyword's own coordinates are added to them.

The Nihilist cipher was used by Russian revolutionary nihilists in the 1880s for secret communications. It combines a keyed Polybius square — which converts letters to numbers — with an additive repeating keyword, producing a numerical ciphertext. It was one of the first hand ciphers to layer two separate operations (substitution then addition), an idea that later evolved into far stronger systems.

How it works

Step 1: Build the keyed Polybius square

Write out the unique letters of a square keyword into a 5×5 grid row by row, then fill the remaining alphabet in order (merging I and J into a single cell since 26 letters do not divide evenly into 25 cells). The rows and columns are numbered 1–5. Each letter’s coordinates become its two-digit code:

Using keyword ZEBRAS:

  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

The letter A = 15, B = 13, R = 14, and so on.

Step 2: Convert the message

Write each plaintext letter as its Polybius number. Spaces and punctuation are typically dropped.

Step 3: Add the keyword

Convert the additive keyword letters to their Polybius numbers as well, then repeat them in a cycle across the message. Add each keyword number to the corresponding message number using ordinary carrying arithmetic:

C = P + K

Step 4: Decipher

Subtract the keyword numbers from the ciphertext, then look each result back up in the Polybius square.

Worked example

Square keyword: ZEBRAS (as above). Additive keyword: RUSSIA.

Encoding DYNAMITE:

LetterP (Polybius)K (RUSSIA)C = P + K
D23R=1437
Y55U=51106
N41S=2162
A15S=2136
M35I=3267
I32A=1547
T45R=1459
E12U=5163

Ciphertext: 37 106 62 36 67 47 59 63

Note that Y + U carries into the hundreds (55 + 51 = 106), which is why the numbers are written space-separated rather than concatenated.

Security and cryptanalysis

The Nihilist cipher is not secure by modern or even early 20th-century standards. Its weaknesses mirror those of the Vigenère cipher:

  • The additive keyword repeats, creating periodic structure that a cryptanalyst can exploit with the Kasiski test or index of coincidence methods.
  • Once the keyword period is found, the cipher reduces to multiple independent Caesar-like shifts on the Polybius numbers — solvable with frequency analysis.
  • A short keyword (especially shorter than the message) makes attacks straightforward; longer keywords delay analysis but do not prevent it.

The cipher was adequate for 1880s hand-transmitted secret communications where opponent cryptanalysis capacity was limited, but modern analysis breaks it quickly given sufficient ciphertext.

The VIC cipher, developed by Soviet intelligence decades later, addressed these weaknesses by replacing the simple Polybius square with a straddling checkerboard (which produces variable-length codes) and adding a columnar transposition stage, making frequency analysis dramatically harder.