The Vigenère cipher is an encryption method that uses a series of different "Caesar ciphers" based on the letters of a keyboard. In a Caesar cipher, each letter during the cipher is shifted by a certain number of letters, to be replaced by the corresponding letter. For example, this means that in a Caesar cipher with the shift of three: A would become D, B would become E, C would become F, etc. A Vigenère cipher is constructed from this method using several Caesar ciphers at different points in the message; this article shows you how to use it.
Steps
Method 1 of 2: Encryption
Step 1. Obtain a Vigenère square (pictured at the bottom of this article) or make your own
Step 2. Think of a keyword that is shorter than the phrase you want to encrypt
For this example we will use:
LIME
Step 3. Write your message without spaces
For this example we will use:
WIKIHOWISTHEBEST
Step 4. Write the keyword under your message, carefully aligning each letter with a letter in your message
Do this until the message ends:
WIKIHOWISTHEBEST
LIMELIMELIMELIME
Step 5. Cut the keyword at the end if necessary
In the example used in this article, the word
LIME
it fits perfectly, but when the word does not fit perfectly, it is not necessary to use the whole word. Eg:
WIKIHOWISTHEBESTOFTHEBEST
LIMELIMELIMELIMELIMELIMEL
Step 6. Go to the row of the first letter of the keyword in the Vigenère square and go to the column of the first letter of the current message, and find the intersection point of the row and the column
This is your letter to encrypt.
Step 7. Continue with this method until the entire sentence is encrypted
The example ends with:
LAYEWGKEHLVAQWGP
Method 2 of 2: Decryption
Step 1. Reverse the previous steps to decrypt
Step 2. Find the column corresponding to the first letter of the ciphertext, and keep going until you reach the row of the first letter of the keyword
That's the first letter of the cipher phrase.
Step 3. Continue like this until you have completely decrypted the text
Step 4. Finished
Advice
- Check to make sure the encryption is correct. Incorrect encryption may be impossible to interpret correctly, and it is difficult to recognize an error without checking again.
- Another encryption method is to find a letter corresponding to the intersection of a row and a column. In this case "the letters W and L correspond to H" and so on. WIKIHOWISTHEBEST becomes HQWMSWIMDBTIMMEX.
- Another method to further obfuscate your message is to apply the Caesar cipher to the original message using a predetermined value (for example: such as ROT13), then apply the Vigenère cipher. Even if decrypted, without knowing that the result was first encrypted with Caesar, indistinguishable words will always appear.
- There are Vigènere decryptors online that you can use to help you crack your code. Do a search to find them.
- When you send the encrypted message to someone else, they must know the key word used to decrypt the code, so let them know it secretly in advance or use a prefixed Caesar cipher to also encrypt the key.
- The more often your "Keyword" or "Key Expression" is repeated, the easier patterns can be recognized in the ciphertext and the easier it is to break the cipher. A "Key" as long as the message or longer is preferable.
- If you use a larger Vigènere square that also includes punctuation and spaces, the cipher becomes more difficult to break. This mainly happens when the "Keyword" or "Key expression" is as long as the message or longer.