The Keyword cipher is a type of substitution cipher, specifically a monoalphabetic substitution cipher. This means that you replace a letter in the plaintext with the same letter every time. For example, if you replace the letter "A" with "H", you must do that for every "A" in the entire plaintext.
Consider the following random substitution table. There's no pattern to how the plaintext maps to the ciphertext. This is the setup to a Random substitution. I explain more how substitution works here.
The keyword cipher requires a "keyword." It's preferable the keyword has no repeated letters. For example, WIZARD is a good keyword. However, the word BASEBALL is bad. The letters "B", "A", and "L" are repeated. I'll discuss after the example what to do when the keyword has repeated letters.
Next step is remove all the letters from the ciphertext table. We're going to start with a clean slate. It should look like this.
Now we place our keyword in the first empty slots in the ciphertext table. Suppose our keyword is WIZARD. It should look like this.
The last step to creating our keyword encryption is to place all the remaining letters of the alphabet in the rest of the boxes. If a letter was used in the keyword then you skip over it.
To encrypt, replace all the letters of your plaintext with the corresponding letter in the ciphertext table. To decrypt, replace all the letters in your ciphertext with the corresponding letter in the plaintext table.
NOTE: If you want to use a keyword with repeated letters, then you have to remove those letters before placing it in the ciphertext boxes. For example, if you want to use BASEBALL, then you need to remove a "B", "A", and "L". So BASEBALL is now BASEL. See? Not that cool of a password now.
Using the keyword WIZARD we get the following encryption for the message ATTACK AT DAWN
|Plaintext:||A T T A C K A T D A W N|
|Ciphertext:||W Q Q W Z G W Q A W U K|
Enter your keyword below and click Generate. The ciphertext boxes will populate with the keyword cipher.
Use the tool above to set your key.
It's easy when you have the shift key. When you encrypt a message you shift all the letters to the RIGHT. To decrypt, you shift all the letters LEFT. If the shift key is K=3, then you shift all the letters LEFT by 3 letters.
Use the shift tool from above.