📝 Keyword Cipher
Encrypt and decrypt text with the Keyword cipher. Build a substitution alphabet from a keyword plus the remaining letters.
About the Keyword Cipher
The Keyword cipher is a monoalphabetic substitution cipher. A secret keyword (with duplicate letters removed) is placed at the start of the cipher alphabet, followed by the remaining letters of the alphabet in order. Each plaintext letter is then replaced by the matching letter in this constructed alphabet. This tool runs entirely in your browser — nothing is uploaded.
How it works
- Build the alphabet — Write the keyword (duplicates removed), then append the remaining letters A–Z that did not appear in the keyword.
- Encrypt — For each plaintext letter, take its position in the normal alphabet and substitute the letter at that position in the cipher alphabet.
- Decrypt — Reverse the lookup: find the cipher letter's position in the cipher alphabet and output the normal-alphabet letter.
- Letter case is preserved; non-letter characters pass through unchanged.
Use cases
- Learning monoalphabetic substitution ciphers.
- Creating simple coded messages and puzzles.
- Understanding how keyword-based alphabets differ from Caesar shifts.
- Demonstrating why fixed substitution is vulnerable to frequency analysis.
Frequently asked questions
Is the Keyword cipher secure? No. As a monoalphabetic cipher it preserves letter frequencies and is easily broken by frequency analysis.
What if my keyword has duplicate letters? Duplicates are ignored — each letter appears only once in the cipher alphabet.
How is this different from a Caesar cipher? Caesar shifts the whole alphabet by a fixed amount, producing only 25 possible alphabets. The Keyword cipher scrambles the alphabet based on a word, giving far more possibilities.
Does this tool upload my text? No. All encryption and decryption happens locally in your browser.