Nihilist Cipher Encoder and Known-Key Decoder
The Nihilist cipher adds a repeating key's Polybius numbers to the message's numbers from a keyed 5x5 square. This workflow opens a valid known-key example using square keyword ZEBRAS and additive key RUSSIAN. Decoding subtracts the key number and looks up the remaining row-column pair. Addition is ordinary arithmetic and can exceed 100. Unknown-key recovery and competition-specific practice sets are not provided.
encode a 5 x 5 square numbered 11 to 55, with I and J in one cell; each letter's number plus the number of the next key letter, the key repeating letter by letter; / between words; case is not kept; digits, punctuation and letters outside A to Z are dropped
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | Z | E | B | R | A |
| 2 | S | C | D | F | G |
| 3 | H | I/J | K | L | M |
| 4 | N | O | P | Q | T |
| 5 | U | V | W | X | Y |
- D23 + R 14 = 37
- Y55 + U 51 = 106
- N41 + S 21 = 62
- A15 + S 21 = 36
- M35 + I 32 = 67
- I32 + A 15 = 47
- T45 + N 41 = 86
- E12 + R 14 = 26
decode subtract the same key numbers, then read each result as row and column
- Square keyword
- Key
- Method
- Nihilist, square ZEBRAS, key RUSSIAN
- Letters to numbers
- 8
- Dropped, no cell
- 0
- Decode
- subtract the same key numbers, then read each result as row and column
Polybius numbers from a keyed 5 x 5 square, with the numbers of a key word added one letter at a time. The sums are ordinary addition, so they can pass 100.
Textbook checks, one per method
Each row is worked by the same code as the stage above. Load puts it in the workbench with its keys.
Common questions
- Why are there two keys?
- The square keyword determines where letters sit in the 5x5 grid. The additive key supplies a repeating sequence of Polybius values to add or subtract. Both must match the sender's convention.
- Does this solve a Nihilist cipher without its key?
- No. It calculates exact known-key encoding and decoding. It does not infer the square or additive key from ciphertext.
- What does an invalid subtraction mean?
- If the difference is not a valid row-column value from 11 to 55, the tool names the position. Check the ciphertext, square keyword and additive key rather than treating a guessed result as plaintext.
Each method follows the convention shown beside it: Caesar shifts count from 0 at the first letter of the alphabet and wrap after the last, the 5 x 5 Polybius and Nihilist squares give I and J one cell, A1Z26 reads 1 26 as AZ, and a book number outside your reference is an error, never a guess. The ranked list of Caesar shifts is an estimate from English letter frequency. These are historical and puzzle ciphers, not modern secure encryption, and the one-time pad mode only shows the arithmetic of the key you type, with no claim that it keeps a message secret.