How to use the keyword substitution tool
- Choose the Direction: Encrypt or Decrypt.
- Enter the Keyword. The default is ZEBRAS.
- Type into Your text.
- Read the Result. Under the converted text the tool prints the Cipher alphabet, so you can check it or write it down for the reader.
What it does and when to use it
A keyword cipher is a simple substitution cipher with an easy-to-share key. Instead of agreeing on a full scrambled alphabet of 26 letters, you only have to agree on one word. Writing the alphabet out by hand is quick, which is why keyword ciphers show up in children’s spy books, classroom codes, escape rooms and cryptogram puzzles.
This is a classical cipher for puzzles and teaching, and it offers no real protection. For a substitution set by a formula instead of a word, try the affine cipher; for one where the substitution changes from letter to letter, see the autokey Vigenère cipher. The same keyword-square idea is used in two dimensions by the Playfair cipher.
How it works
With the keyword ZEBRAS, the two alphabets line up like this:
Plain: 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: Z E B R A S C D F G H I J K L M N O P Q T U V W X Y
Encrypting finds each letter in the top row and writes the letter below it, so F becomes S and L becomes I. Decrypting does the reverse, from the bottom row to the top. Lower-case letters stay lower case, and anything that is not A to Z or a to z, including digits, punctuation and accented letters, is copied as it is. The work happens in your browser.
Worked examples
Results from the tool:
Flee at once. We are discovered! ZEBRAS → Siaa zq lkba. Va zoa rfpbluaoar!
SIAA ZQ LKBA ZEBRAS, Decrypt → FLEE AT ONCE
Meet at 10, Zoë Secret Key → Http sp 10, Zjë
Each result is followed by a line such as “Cipher alphabet: ZEBRASCDFGHIJKLMNOPQTUVWXY”. In the first line the double E in “flee” becomes a double A, which shows how patterns survive. In the third, Secret Key gives the alphabet SECRTKYABDFGHIJLMNOPQUVWXZ; the 10 and the ë are untouched and Z stays Z.
Limits and tips
- Remove spaces and punctuation before encrypting if you want to hide word lengths; the tool keeps them.
- When you copy the result, leave out the “Cipher alphabet” line if the reader should not see it.
- Longer keywords with many different letters make a more mixed alphabet, but never a secure one.
Frequently asked questions
How is the cipher alphabet built?
Why did some letters not change?
Do spaces or digits in the keyword matter?
Can this cipher be broken?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.