How to use the keyed substitution cipher
- Enter a short plaintext or ciphertext message and choose Encode or Decode. The message may contain spaces, punctuation, numbers, and other scripts, but it must include at least one English A–Z letter.
- Enter exactly 26 letters in the key field. The first key letter replaces A, the second replaces B, and so on through Z. A valid key is a permutation: every A–Z letter appears once.
- Select Convert. Encode follows the plain-to-key alphabet; Decode constructs the inverse mapping from the same key.
- Copy result copies only the converted message. Editing the message, key, or direction immediately clears the previous result and copied status.
How a 26-letter substitution key works
Write the ordinary alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ above the key alphabet. With the example QWERTYUIOPASDFGHJKLZXCVBNM, A maps to Q, B to W, C to E, and Z to M. Encoding replaces each plaintext letter using that column. Decoding reverses the lookup: Q maps back to A, W to B, and M to Z.
A complete permutation is required so that every ciphertext letter has one and only one plaintext partner. A missing letter makes part of the mapping undefined; a repeated letter makes the inverse ambiguous. The validator therefore distinguishes wrong length, non-A–Z characters, and duplicates rather than attempting to repair the key. Key case is ignored, while the case of each message letter is preserved.
Only unaccented English letters in the message are substituted. Spaces, punctuation, digits, emoji, accented letters, Korean, Japanese, and other scripts remain at their original positions. Unlike Vigenère, the mapping never advances with position: the same plaintext letter always produces the same ciphertext letter.
Exact substitution examples
Key QWERTYUIOPASDFGHJKLZXCVBNM maps ABC XYZ → QWE BNM. Decode QWE BNM with the same key to recover ABC XYZ. This alphabet-edge vector checks both ends of the mapping.
With the same key, HELLO! → ITSSG!. Decoding ITSSG! returns HELLO!, while the exclamation mark remains unchanged. These vectors are asserted independently in the feature tests.
When this translator is useful
- Create or check a classroom monoalphabetic-substitution exercise when sender and receiver share the complete key alphabet.
- Solve a puzzle after its exact mapping has been supplied, or verify that a proposed permutation can decode every letter uniquely.
Key requirements and security limits
- The page requires the complete 26-letter key. It does not infer a key from ciphertext, test word frequencies, rank candidate plaintext, or promise an automatic solution. A decoder result is meaningful only when the supplied key matches the message.
- Simple substitution preserves letter-frequency patterns and is not modern encryption. Do not use it for passwords or private data. The page has no file upload, storage, account, network decoder, custom alphabet, homophonic symbols, or keyword-to-alphabet generator.
Substitution cipher FAQ
What order do the 26 key letters use?
Position 1 replaces A, position 2 replaces B, and position 26 replaces Z. The ordinary alphabet is the fixed source row.
Why are duplicate letters rejected?
Two plaintext letters would share one ciphertext letter, so decoding could not choose a unique original. A permutation prevents that ambiguity.
Does Decode need a second inverse key?
No. The tool builds the inverse lookup from the same valid 26-letter key.
Can this solve ciphertext without a key?
No. Automatic key search and frequency analysis are explicitly outside this exact-mapping translator.