šŸ”¢ Nihilist Cipher — Step-by-Step Example

Welcome, codebusters! The Nihilist cipher turns letters into numbers using a special grid, then adds a secret key to scramble everything. Let's break it down!


šŸ¤” What is the Nihilist Cipher?

The Nihilist cipher has three ingredients:

  1. A Polybius Square — a 5Ɨ5 grid filled with the alphabet (I and J share a spot).
  2. A keyword used to build the grid.
  3. A key phrase that generates numbers to add on top.

The result? A series of two-digit numbers that hide your message!


šŸ“œ The Problem

Encrypt the message: ROCKET Grid keyword: COMET Key phrase: MARS


šŸ•µļø Step-by-Step Encryption

Step 1: Build the Polybius Square

Take the keyword COMET and write its unique letters first, then fill in the rest of the alphabet (skipping any letters already used, and combining I/J into one cell):

Starting with C, O, M, E, T, then continue with A, B, D, F, G, H, I/J, K, L, N, P, Q, R, S, U, V, W, X, Y, Z:

     1    2    3    4    5
  ā”Œā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”
1 │  C │  O │  M │  E │  T │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
2 │  A │  B │  D │  F │  G │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
3 │  H │ I/J│  K │  L │  N │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
4 │  P │  Q │  R │  S │  U │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
5 │  V │  W │  X │  Y │  Z │
  ā””ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”˜

How to read it: Each letter gets a 2-digit number — the row first, then the column.


Step 2: Convert the plaintext to numbers

Look up each letter of ROCKET in the grid:

Letter Row Column Number
R 4 3 43
O 1 2 12
C 1 1 11
K 3 3 33
E 1 4 14
T 1 5 15

Plaintext numbers: 43 12 11 33 14 15


Step 3: Convert the key phrase to numbers

Now look up each letter of the key MARS in the same grid:

Letter Row Column Number
M 1 3 13
A 2 1 21
R 4 3 43
S 4 4 44

Key numbers: 13 21 43 44


Step 4: Repeat the key to match the message length

Our message has 6 letters, but our key only has 4 numbers. So we repeat the key:

Plaintext:  R    O    C    K    E    T
            43   12   11   33   14   15

Key:        M    A    R    S    M    A
            13   21   43   44   13   21
            ↑ key starts over ──────↑

Step 5: Add the numbers!

Simply add each plaintext number to its matching key number:

Plaintext Key Sum (Ciphertext)
43 13 56
12 21 33
11 43 54
33 44 77
14 13 27
15 21 36

āœ… Ciphertext: 56 33 54 77 27 36


šŸ”“ Now Let's Decrypt It!

You received this ciphertext: 56 33 54 77 27 36 You know the grid keyword is COMET and the key phrase is MARS.

Step 1: Build the same Polybius Square

(Same grid as before — use keyword COMET)

     1    2    3    4    5
  ā”Œā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”
1 │  C │  O │  M │  E │  T │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
2 │  A │  B │  D │  F │  G │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
3 │  H │ I/J│  K │  L │  N │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
4 │  P │  Q │  R │  S │  U │
  ā”œā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¤
5 │  V │  W │  X │  Y │  Z │
  ā””ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”˜

Step 2: Convert the key phrase to numbers

MARS → 13 21 43 44 (same as before)

Repeat to match ciphertext length: 13 21 43 44 13 21

Step 3: Subtract the key from the ciphertext

This is the reverse of encryption — instead of adding, we subtract:

Ciphertext Key Difference (Plaintext #)
56 13 43
33 21 12
54 43 11
77 44 33
27 13 14
36 21 15

Step 4: Look up the numbers in the grid

Number Row Column Letter
43 4 3 R
12 1 2 O
11 1 1 C
33 3 3 K
14 1 4 E
15 1 5 T

āœ… Plaintext: ROCKET šŸš€šŸŽ‰


🧠 Key Things to Remember

  1. Build the grid with the keyword first — write the unique letters of the keyword, then fill in the remaining alphabet letters. I and J always share one cell.
  2. Row number comes first, then column. So Row 4, Column 3 = 43 (not 34!).
  3. The key repeats to match the length of the message.
  4. Encrypt = ADD. Decrypt = SUBTRACT.
  5. Every ciphertext number will be between 22 and 110 (smallest: 11+11=22, largest: 55+55=110).

šŸŽÆ Practice Problem

Decrypt this ciphertext using grid keyword COMET and key phrase MARS:

57  36  64  87

Hint: Build the same grid, convert MARS to numbers, and subtract!

Click to reveal the answer

Step 1: Build the COMET Polybius square (same as above).

Step 2: Convert MARS to key numbers: M=13, A=21, R=43, S=44

Step 3: Subtract key from ciphertext:

Plaintext: STAR ⭐

Happy number crunching! šŸ”šŸ†