Nihilist Cipher Tool - Encode and Decode

Plaintext
Ciphertext
12345
1ABCDE
2FGHIK
3LMNOP
4QRSTU
5VWXYZ

What is the Nihilist Cipher?

The Nihilist Cipher is a letter-to-number encryption method, where the core principle involves converting letters into numbers using a matrix and then encrypting those numbers with a key. Unlike the Polybius Square Cipher, the Nihilist Cipher adds complexity through the use of a key, making the encryption and decryption process more secure. Even if an attacker obtains the encrypted text, they cannot easily recover the original plaintext without the key.

How Does the Nihilist Cipher Encrypt?

  1. Define the Alphabet, Rows, Columns, and Key:
    • Alphabet: Choose an alphabet (e.g., the English alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ" or another language's alphabet).
    • Rows and Columns: Select the number of rows and columns based on the length of the alphabet. For example, for 26 letters, a 5x5 matrix is commonly used.
    • Key: Choose a letter (or string) from the alphabet as the key. The letters in the key will be converted into row-column coordinates within the matrix.
  2. Generate the Matrix: Based on the alphabet, rows, and columns, the system will automatically generate the corresponding matrix.
  3. Convert the Plaintext to Numbers: Convert each letter of the plaintext into corresponding row-column numbers based on the matrix.
  4. Convert the Key to Numbers: Convert each letter of the key into its corresponding row-column numbers based on the matrix.
  5. Apply Key to Numbers: Add the key's numbers to the numbers from the plaintext. If the key is shorter than the plaintext, repeat the key to match the length of the plaintext.
  6. Output the Ciphertext: Combine the resulting numerical pairs into the final ciphertext.

Example

Suppose you want to encrypt the plaintext "HELLO" with the key "KEY" using the alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and a 5x5 matrix:

12345
1ABCDE
2FGHI / JK
3LMNOP
4QRSTU
5VWXYZ

Convert the plaintext "HELLO" to numerical coordinates:

Convert the key "KEY" to numerical coordinates:

Add the coordinates of the plaintext and key:

Hello(2, 3)(1, 5)(3, 1)(3, 1)(3, 4)
Key(2, 5)(1, 5)(5, 4)(2, 5)(1, 5)
Ciphertext(4, 8)(2, 10)(8, 5)(5, 6)(4, 9)

So, the final encrypted numbers are: 48 30 85 56 49.

How Does the Nihilist Cipher Decrypt?

Decryption follows a similar process to encryption but requires reversing the operations (subtracting the key's coordinates from the ciphertext's coordinates). For example, using the ciphertext: 48 30 85 56 49, the decryption steps are as follows:

Ciphertext(4, 8)(3, 0)(8, 5)(5, 6)(4, 9)
Key(2, 5)(1, 5)(5, 4)(2, 5)(1, 5)
Plaintext(2, 3)(1, 5)(3, 1)(3, 1)(3, 4)

Convert the numerical pairs back to the original letters:

Thus, the decrypted plaintext is: HELLO.

How to Use the Nihilist Cipher Tool?

  1. Choose Alphabet, Set Rows and Columns: In the tool, you can select the alphabet (supporting multiple languages), and set the number of rows and columns (default is 5x5).
  2. Define the Key and Separator: Set the key for encryption (which can be any string of letters) and choose the separator (default is space).
  3. Input Plaintext or Ciphertext: Depending on whether you need to encrypt or decrypt, input the plaintext or ciphertext into the appropriate text box. The tool will automatically handle the encryption or decryption based on your settings.
  4. View the Result: The tool will display the encrypted or decrypted result for you to use.

Share This Page