ForHosting KIT · Developer Utilities

Nihilist cipher

HELLO, encrypted with the keyword ZEBRAS and the key 1234, becomes 43 46 46 68 54. The keyword builds a five-by-five letter square, the key adds a repeating number to each letter code, and decrypting subtracts it again. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
HELLO
Keyword
ZEBRAS
Key
1234
Calculation mode
Encrypt
You get
Result
43 46 46 68 54
Key numbers
12, 34
Length
14
Letters mapped
5

The Nihilist cipher is a classical additive cipher used historically by Russian revolutionaries: first a keyword fills a five-by-five Polybius square so each Latin letter becomes a two-digit row-column code, then a repeating numeric key is added to those codes to produce a stream of integer sums. Decrypting subtracts the same key and maps valid codes back to letters on the same square. You supply plain text or space-separated ciphertext, a square keyword, and a numeric key (digit pairs such as 1234 or explicit numbers like 12 34), choose encrypt or decrypt, and receive a deterministic result with polybius codes, key numbers, and alphabet metadata.

How the Nihilist cipher combines Polybius codes and a numeric key

Start with a Polybius square keyword. Unique Latin letters from the keyword are written first into a five-by-five grid, mapping J onto I so twenty-six letters fit twenty-five cells, then the remaining alphabet fills the rest in order. Each cell has a row and column from one to five, so every letter maps to a two-digit code such as eleven through fifty-five depending on where it landed for that keyword.

Encryption walks the plaintext once, skips non-letters, records each letter code, and adds the next value from a repeating numeric key. Continuous keys with an even digit count pair as two-digit numbers—1234 becomes twelve then thirty-four—while space or comma separated tokens are parsed as explicit integers. The ciphertext is those sums written as a space-separated string, not a letter string, because addition routinely produces two-digit and three-digit totals.

The path uses no network, no Date, and no randomness. This landing implements classical additive Nihilist only, not Bifid fractionation, not ADFGVX, and not automatic recovery of unknown keys.

Where Nihilist cipher tools show up in real work

Introductory cryptography and history-of-codes courses assign Nihilist drills so students practice combining a coordinate substitution table with modular-style addition before they meet true polyalphabetic systems; a single trusted oracle that encrypts and decrypts with textbook square-plus-key rules speeds homework demos and auto-graders. Capture-the-flag warm-ups and puzzle hunts still hide space-separated integer streams that reverse only when both the square keyword and numeric key are known, and solvers want a fast, predictable tool rather than a general cryptanalysis suite.

Support and content teams sometimes lightly encode spoilers or internal labels as Nihilist sums and need the reverse path without installing a language-specific crypto library. If you need a plain Polybius square without addition, Bifid fractionation, Caesar letter shifts, Autokey or Beaufort keyword ciphers, or automatic frequency-analysis recovery of unknown keys, treat those as separate search intents and landings rather than overloading this classical Nihilist cipher page.

Classroom additive-cipher demos

Encrypt and decrypt sample words with a square keyword and numeric key so intro-crypto lessons share one ground-truth Nihilist mapping.

Puzzle and CTF integer-stream challenges

Encode or reverse space-separated Nihilist sums on challenge strings without writing a one-off script for every problem set.

What is the Nihilist cipher?

A classical cipher that maps letters through a keyed 5×5 Polybius square, then adds a repeating numeric key to each two-digit code. Ciphertext is space-separated integer sums.

What is the difference between keyword and key?

keyword builds the Polybius square (letter order). key is the numeric additive stream—digit pairs like 1234 or spaced integers like 12 34—that is added on encrypt and subtracted on decrypt.

Why does an empty key fail?

Both the square keyword and the numeric key must be non-empty.

How do I decrypt a sum stream?

Set mode to decrypt, paste space-separated integers, and reuse the same keyword and numeric key. Each sum minus the cycling key must land on a valid square code.

What does it cost?

The browser tool is free and runs locally.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/nihilist

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/nihilist \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"HELLO","keyword":"ZEBRAS","key":"1234"}'
{
  "text": "HELLO",
  "keyword": "ZEBRAS",
  "key": "1234"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.nihilist",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Empty keywords and empty numeric keys fail immediately with invalid_input so callers never confuse a blank secret with a silent no-op.

How the Nihilist cipher combines Polybius codes and a numeric key

Decryption reverses the path: parse each integer token, subtract the cycling key, and require the difference to be a valid code on the same keyed square; otherwise the request fails with invalid_input rather than inventing a letter. There is no modern padding, no authenticity tag, and no random nonce—identical text, keyword, key, and mode always yield identical JSON.

What you send and what you get back

Send a required string field named text, a required keyword for the Polybius square, a required key for the numeric additive stream, and an optional mode set to encrypt or decrypt. Classic checks include encrypting HELLO with keyword ZEBRAS and key 1234 to 43 46 46 68 54, decrypting that stream back to HELLO, and confirming that an empty key is rejected rather than treated as zero. When mode is omitted, encrypt is the default so a minimal payload still does useful work. On success the response echoes mode, text, keyword, and key; returns key_numbers as the parsed additive sequence; result as the transformed string; length of that result; letters_mapped as how many cells were encoded or decoded; polybius_codes and sums for the intermediate arithmetic; plus square, ij_combined, alphabet, and cipher labels for clients that assert the profile they hit. Missing text, keyword, or key; empty keyword or empty numeric key; letter-free keywords; keys that are not digits; continuous keys with an odd digit count; unsupported mode values; strings longer than the documented maximum; decrypt payloads without numbers; and sums that do not reverse to a valid square code all fail with invalid_input and a clear English message. Validation failures do not consume prepaid balance. Pricing for successful API calls is the published base of $0.002 per item.

Where Nihilist cipher tools show up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Lightweight label and spoiler encoding

Turn quiz answers or internal labels into keyed Polybius-plus-sum streams and decode them later with the same contract in browser or API.

Read the full KIT documentation →