Keyword Cipher: Encoder, Decoder, and Alphabet Mapping

Use a keyword-based substitution alphabet to encrypt and decrypt text, inspect letter mappings, and compare frequency patterns for manual analysis.

Result
0 characters
Keyword:
Options:Preserve Case

Alphabet Mapping

Standard Alphabet

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z

Cipher Alphabet

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Enter a keyword to see the cipher alphabet

Frequently Asked Questions About Keyword Cipher

What is a keyword cipher?

A keyword cipher is a monoalphabetic substitution cipher that builds a custom alphabet from a keyword. Unique keyword letters come first, then the remaining unused letters are appended in normal order.

How do you create a keyword cipher alphabet?

Write the keyword, remove duplicate letters, and then append the rest of the alphabet while skipping letters already used. The resulting alphabet becomes the substitution mapping.

How do you decrypt a keyword cipher?

If you know the keyword, regenerate the cipher alphabet and reverse the substitution. If you do not know the keyword, frequency analysis and pattern matching can help recover likely mappings.

What makes a good keyword?

Longer keywords with many unique letters scramble more of the alphabet and are harder to guess. Avoid short or alphabetically ordered words.

Keyword Cipher: Classical Substitution Encryption - Free Online Tool

The Keyword cipher, also known as the monoalphabetic substitution cipher, is a classical encryption technique that uses a keyword to create a unique cipher alphabet. Unlike simple shift ciphers, keyword ciphers provide variable substitution patterns that make them more resistant to basic cryptanalysis while remaining accessible for educational purposes.

How the Keyword Cipher Works

The keyword cipher creates a substitution alphabet by placing a chosen keyword at the beginning of the cipher alphabet, followed by the remaining letters in standard alphabetical order.

Algorithm Process
  1. Keyword Preparation: Remove duplicate letters and convert to uppercase

    • Example: "grandmother" → "GRANMOTHE"
  2. Remaining Letters: Identify letters not in the keyword

    • Remaining: BCDFIJKLPQSUVWXYZ
  3. Cipher Alphabet: Combine keyword + remaining letters

    • Final: GRANMOTHEBCDFIJKLPQSUVWXYZ
  4. Letter Mapping: Create substitution table

    • A→G, B→R, C→A, D→N, E→M...
Complete Example
Keyword: "ZEBRAS"
Plain:   ABCDEFGHIJKLMNOPQRSTUVWXYZ  
Cipher:  ZEBRASCDFGHIJKLMNOPQTUVWXY

Message:   "MEET AT DAWN"
Encrypted: "KIIQ ZQ NZVO"

Free Online Keyword Cipher Tool Features

Our comprehensive keyword cipher tool includes:

  • Bidirectional Processing: Both encryption and decryption modes
  • Custom Keywords: Use any keyword to generate unique cipher alphabets
  • Case Preservation: Options to maintain original text formatting
  • Character Set Support: Handle spaces and punctuation appropriately
  • Alphabet Mapping Visualization: See how letters transform
  • Frequency Analysis: Built-in statistical analysis tools
  • Random Keyword Generator: Generate secure keywords automatically

Security Analysis and Cryptanalysis

Despite their historical importance, keyword ciphers are fundamentally vulnerable to modern cryptanalytic techniques:

Frequency Analysis Vulnerability
  • Method: Statistical analysis of letter frequencies
  • Requirement: Approximately 27.6 letters of ciphertext
  • Process: Compare cipher frequencies to expected English frequencies (E=12.02%, T=9.06%, A=8.12%)
  • Success Rate: Very high with sufficient text
Pattern Recognition Attacks
  • Method: Identify common words and patterns
  • Targets: Articles ("THE", "AND"), repeated words
  • Indicators: Word lengths, punctuation patterns
  • Automation: Modern algorithms process thousands of possibilities

Explore these related classical encryption techniques:

Further Reading

Explore keyword cipher history, advanced cryptanalysis, and code implementations: