ForHosting KIT · Developer Utilities

Monoalphabetic substitution cipher

With the key QWERTYUIOPASDFGHJKLZXCVBNM, Hello World becomes Itssg Vgksr: you supply the whole 26-letter cipher alphabet, every letter keeps one fixed replacement, and decrypting reverses the table. 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 World
Key
QWERTYUIOPASDFGHJKLZXCVBNM
Action
Encrypt
You get
Result
Itssg Vgksr
Alphabet
QWERTYUIOPASDFGHJKLZXCVBNM
Letters mapped
10

A simple substitution cipher, also called a monoalphabetic cipher, replaces every letter of the alphabet with exactly one other letter and keeps that mapping fixed for the whole message. Unlike a keyword cipher that builds the alphabet from a short seed, this tool takes the full twenty-six-letter cipher alphabet as the key so you control every mapping directly. Paste your plaintext or ciphertext, supply a permutation of A through Z, choose encrypt or decrypt, and receive the transformed string with a count of letters mapped. Spaces, digits, and punctuation pass through unchanged while letter case is preserved. Use it for classroom monoalphabetic demos, puzzle design, CTF warm-ups, and reversible obfuscation of short notes.

How the monoalphabetic key alphabet works

In a classical simple substitution cipher the plaintext alphabet A through Z is paired position-by-position with a cipher alphabet of the same length. The key you provide is that cipher alphabet: the first character replaces A, the second replaces B, and so on through Z. For example, the key QWERTYUIOPASDFGHJKLZXCVBNM maps plain A to Q, B to W, C to E, and so forth, producing a fixed monoalphabetic table for the whole message.

Encryption looks up each letter in the plain alphabet and emits the character at the same index in the key; decryption does the reverse lookup so round-trips restore the original letter casing and non-letter characters exactly. Digits, spaces, punctuation, emoji, and non-Latin scripts never enter the map—they are copied through so dates, codes, and formatting stay readable. Uppercase and lowercase forms of the same letter share one map entry; the engine preserves the case of each source character so HELLO and hello encrypt consistently relative to the same key.

Because the mapping is fixed for every letter of the message, frequency analysis can still break long English ciphertext; this tool is for teaching, puzzles, and light obfuscation, not for protecting secrets at rest or in transit. Prefer this landing when the search intent is monoalphabetic substitution cipher or simple substitution with a full key alphabet; keyword-seeded alphabets, Caesar shifts, and Vigenère polyalphabetic ciphers answer different intents and stay separate tools.

Encrypt, decrypt, and incomplete key validation

Send a required text string and a required key string, and optionally set action to encrypt or decrypt (encrypt is the default). The key is trimmed and must contain only letters A through Z. After normalization to uppercase it must be exactly twenty-six characters long and use each letter of the alphabet exactly once.

Encrypt walks plaintext letters from the plain alphabet into the key alphabet; decrypt walks the opposite direction. Status is beta while the public surface stabilizes, but the substitution rules follow this fixed classical construction and will not change for identical inputs.

Substitution alphabets in class and their limits

Call the capability with text and key as required fields. Use action decrypt when the text is already ciphertext produced by the same key alphabet. A typical lesson shows students a hand-written 26-letter permutation, encrypts a short English sentence, then decrypts to prove invertibility, and finally contrasts the fixed map with a polyalphabetic cipher later in the syllabus.

Support playbooks can reverse lightly obfuscated ticket notes that staff intentionally wrote with a shared substitution alphabet. Never treat simple substitution as a substitute for AES or authenticated encryption: letter frequencies leak structure on longer English text. Pair the tool with your lesson notes or puzzle brief so students can verify hand work against a stable reference.

Classroom monoalphabetic demos

Show students a full 26-letter cipher alphabet, encrypt a sample sentence, decrypt it back, and explain why incomplete keys are rejected.

Puzzle and CTF warm-ups

Generate reversible ciphertext for scavenger hunts, escape rooms, and introductory crypto challenges with a known substitution key.

Light reversible obfuscation

Scramble short labels or notes with a shared full alphabet when you need quick round-trip mapping rather than real cryptography.

What inputs does the monoalphabetic substitution cipher need?

Required text and key. The key must be exactly 26 unique letters A–Z. Optional action is encrypt (default) or decrypt.

What is an incomplete key?

A key that is not exactly 26 unique A–Z letters—wrong length, missing letters, or repeats.

Is the cipher deterministic and secure?

It is fully deterministic for the same text, key, and action. It is a classical monoalphabetic cipher for teaching and puzzles, not modern cryptographic security.

How does the 26-letter key work?

The key is read against the normal alphabet, position by position: its first letter replaces A, the second replaces B, and so on to Z. With QWERTYUIOPASDFGHJKLZXCVBNM, A becomes Q, B becomes W and C becomes E.

How is this different from a keyword cipher?

A keyword cipher builds its alphabet from a short word and fills in the rest. Here you supply all 26 letters yourself, so you control every single mapping, as long as each letter appears exactly once.

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/simple-substitution

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/simple-substitution \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello World","key":"QWERTYUIOPASDFGHJKLZXCVBNM"}'
{
  "text": "Hello World",
  "key": "QWERTYUIOPASDFGHJKLZXCVBNM"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.simple_substitution",
  "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.

Incomplete keys—too short, too long, or with repeated letters—fail immediately with a clear invalid_input message so a partial alphabet never silently becomes a broken map.

Encrypt, decrypt, and incomplete key validation

If the key is missing or empty after trim, the call fails with invalid_input naming the missing key. If the length is not twenty-six, the call fails reporting an incomplete key and the actual length so you can finish the alphabet instead of receiving a silently padded or truncated map. If any letter appears more than once, the call fails naming the repeated letter as an incomplete key—a permutation must cover every letter once. On success the response echoes the original text, the normalized uppercase key, the action used, the alphabet field (same as the key for this construction), the transformed result string, and letters_mapped counting how many alphabetic characters were substituted.

API usage, pricing, classroom workflows, and practical limits

Pricing for the hosted API is a flat $0.002 per successful request; validation failures such as a missing key, incomplete key, or repeated letter do not consume balance. Keep payloads to ordinary text sizes appropriate for a Worker isolate item call; this tool is for messages and snippets, not multi-megabyte binary blobs. Keep field names explicit rather than packing free-form prose: the contract stays aligned with OpenAPI, SDK types, and form controls.

What does a successful response include?

The original text, normalized key, action, alphabet (the key), the result string, and letters_mapped (count of A–Z characters substituted).

How much does the simple substitution cipher API cost?

Each successful API call costs $0.002. The same engine runs free in your browser with no account required.

Read the full KIT documentation →