gizmobench
BrowseDaily

Keyword Substitution Cipher Encoder and Decoder

A keyword cipher begins its ciphertext alphabet with the keyword, removing repeats, then appends unused A to Z letters. This example uses KRYPTOS to encode KNOWLEDGE IS POWER. Inspect the complete alphabet mapping and the first 12 substitutions. Decode requires the same keyword; this page does not recover an unknown substitution key.

Cipher textKeyword, key KRYPTOS
DGHVETPST BM IHVTL

encode cipher alphabet: the keyword's letters with repeats dropped, then the rest of A to Z in order; case kept; everything else passes through

plainABCDEFGHIJKLM
cipherKRYPTOSABCDEF
plainNOPQRSTUVWXYZ
cipherGHIJLMNQUVWXZ
  1. Kplain position 10, cipher letter D
  2. Nplain position 13, cipher letter G
  3. Oplain position 14, cipher letter H
  4. Wplain position 22, cipher letter V
  5. Lplain position 11, cipher letter E
  6. Eplain position 4, cipher letter T
  7. Dplain position 3, cipher letter P
  8. Gplain position 6, cipher letter S
  9. Eplain position 4, cipher letter T
  10. Iplain position 8, cipher letter B
  11. Splain position 18, cipher letter M
  12. Pplain position 15, cipher letter I

and 4 more, worked the same way

decode decode by finding each letter in the cipher alphabet and reading the plain letter above it

Keyword
Method
Keyword, key KRYPTOS
Letters substituted
16
Passed through
2
Decode
decode by finding each letter in the cipher alphabet and reading the plain letter above it

The keyword, with repeated letters dropped, starts the cipher alphabet and the unused letters follow in order. Each plain letter swaps for the letter in the same place below it.

Textbook checks, one per method

Each row is worked by the same code as the stage above. Load puts it in the workbench with its keys.

  • Caesar, shift 3ABCXYZ
    DEFABC
  • Keyword KRYPTOSKNOWLEDGE IS POWER
    DGHVETPST BM IHVTL
  • Polybius 5 x 5, I and J share cell 24JAM
    24 11 32, which decodes as IAM
  • A1Z26, numbers separated by spaces1 26
    AZ
  • Nihilist, square ZEBRAS, key RUSSIANDYNAMITE WINTER PALACE
    37 106 62 36 67 47 86 26 / 104 53 62 77 27 55 / 57 66 55 36 54 27
  • Book cipher, a 40-word reference text3 17 52
    error: word 52 is outside the 40-word reference, and nothing is guessed
  • One-time pad, key XMCKLHELLO
    EQNVZ
Puzzles and teaching, not secrets. These are historical and puzzle ciphers. Caesar has only 25 shifts on A to Z, so the ranked list that Decode shows reads most messages without the key, and keyword, Polybius and A1Z26 text gives way to letter counting. The one-time pad mode shows the arithmetic of a key you type and nothing more: this tool does not make keys and makes no claim that a message stays secret.
Accuracy. Each method follows the convention shown beside it: Caesar shifts count from 0 at the first letter of the alphabet and wrap after the last, the 5 x 5 Polybius and Nihilist squares give I and J one cell, A1Z26 reads 1 26 as AZ, and a book number outside your reference is an error, never a guess. The ranked list of Caesar shifts is an estimate from English letter frequency. These are historical and puzzle ciphers, not modern secure encryption, and the one-time pad mode only shows the arithmetic of the key you type, with no claim that it keeps a message secret.

Common questions

How do I decode a keyword cipher?
Select Decode, supply the original keyword and paste the ciphertext. Each ciphertext letter is looked up in the keyed alphabet and replaced by the matching ordinary A to Z letter.
Can I supply the entire substitution alphabet?
Yes. A full 26-letter permutation can be supplied as the keyword. The mapping is used in that order. This convention does not implement keyed Caesar rotation, a separate key-letter offset or keyword transposition.
What happens to repeated keyword letters?
Only their first occurrence is kept. All unused alphabet letters follow in order. An identity alphabet is refused because it would change nothing.

Each method follows the convention shown beside it: Caesar shifts count from 0 at the first letter of the alphabet and wrap after the last, the 5 x 5 Polybius and Nihilist squares give I and J one cell, A1Z26 reads 1 26 as AZ, and a book number outside your reference is an error, never a guess. The ranked list of Caesar shifts is an estimate from English letter frequency. These are historical and puzzle ciphers, not modern secure encryption, and the one-time pad mode only shows the arithmetic of the key you type, with no claim that it keeps a message secret.