Nihilist Cipher Encoder – Encrypt With a Keyword Square

What a Nihilist cipher is

The Nihilist cipher is a classical cipher from the 1880s, used by Russian revolutionaries called Nihilists, and it mixes two ideas: a Polybius square and addition. First a keyword builds a 5 by 5 square of letters, with I and J sharing one cell so the 26 letters fit in 25 cells. Each letter then has a two-digit code: its row and its column, both from 1 to 5. Then each message letter is added to a key letter, as plain numbers, and the sums are the cipher text.

For example, with the keyword KEY the square starts K E Y A B on the first row, then C D F G H, then I L M N O, then P Q R S T, then U V W X Z. The letter H is in row 2, column 5, so its code is 25. The letter K is in row 1, column 1, so its code is 11. Adding them gives 36, and 36 is the first cipher number for the message HI with the key KEY.

How to use the encoder

Type your message in the first box, using letters only, and type a keyword in the second box. A short word like KEY works, and a longer word makes a more mixed square. Press the button, or just type, and the tool shows three things: the cipher numbers in big type, the square itself, and a line that shows each letter pair added together.

To read the message back, the reader needs the same keyword. They build the same square, then subtract each key letter code from each cipher number, and turn the result back into a letter. Both sides must use the same keyword, or the message stays unreadable, so agree on the keyword before you send anything.

Worked example

Take the message HI and the keyword KEY. The square is K E Y A B, C D F G H, I L M N O, P Q R S T, U V W X Z. H is 25 and K is 11, so 25 plus 11 is 36. I is 31 and E is 12, so 31 plus 12 is 43. The cipher text is 36 43.

Take the message HELLO and the keyword KEYKE. H is 25 and K is 11, so the first number is 36. E is 12 and E is 12, so the second is 24. L is 32 and Y is 13, so the third is 45. The second L is 32 and K is 11, so the fourth is 43. O is 35 and E is 12, so the fifth is 47. The cipher text is 36 24 45 43 47. The same square and the same addition work for any message.

Who uses this encoder

Students of codebreaking use it most, because it shows how two simple ideas, a square and addition, combine into a cipher that is much harder than either one alone. Teachers use it in class to show the Polybius square in action, with the square and the sums right under the result. Puzzle fans use it to build challenges for friends, with the keyword hidden in a clue.

It also helps writers and game makers who want a secret message made of numbers in a story or a game. A string of two-digit numbers looks like a code from a spy novel, and the reader can decode it with a pencil and the same keyword. It is a cipher for play and learning.

Honest limitations

This tool is a classical cipher for fun and learning, not real security. A Nihilist cipher is stronger than a plain substitution, but it is still breakable: the sums keep some pattern, and a long message can be attacked by guessing the keyword. Never use it to protect real secrets.

The tool also merges I and J into one cell, so the reader must guess which one was meant when a decoded letter is I. Spaces and punctuation are dropped too, so the cipher text has no word breaks, and the reader must guess where the words split. The keyword repeats when it runs out, and that repeat weakens the cipher, so use a keyword as long as you can.

Frequently asked questions

Why do I and J share a cell? The square has 25 cells and the alphabet has 26 letters, so one pair must share. I and J are the usual pair, because they look alike and J is rare in English. The reader guesses from context which one was meant.

Why add the numbers instead of swapping letters? Adding mixes the message with the key, so the same message letter becomes a different number each time it meets a different key letter. That breaks the simple letter-counting attack that defeats a plain square.

How does the reader decode it? They build the same square from the keyword, then subtract each key letter code from each cipher number. For example, 36 minus 11 is 25, which is row 2, column 5, or H.

Can the sums go above 55? Yes. The biggest letter code is 55, so a sum can reach 110, like 55 plus 55. That is normal: the reader subtracts the key code and gets a code back inside the square.

También disponible en español: Codificador De Cifrado Nihilista – Cifra Con Un Cuadrado De Palabra Clave

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top