Example of a vigenere cipher encryption.
by fortenforge, Aug 20, 2009, 9:33 PM

This is an example of a Vigenere square. The columns are all the possible keys or alphabets and the row is the letter you are trying to encrypt/decrypt.
Let us say that this was our plaintext:
"WE DONT GO TO AFRICA TO STEAL NO COCONUTS"
We would first remove spaces.
WEDONTGOTOAFRICATOSTEALNOCOCONUTS
Then we would choose a keyword. Let us say that we chose the word GOLD.
GOLDGOLDGOLDGOLDGOLDGOLDGOLDGOLDG
WEDONTGOTOAFRICATOSTEALNOCOCONUTS
We first encrypt the letter 'W' with key G. This means that we find the row W on our vigenere square and find the letter in column G. This letter becomes our ciphertext letter. This also means that we encrypt the letter 'W' with a caesar cipher of key 'G'. 'G' corresponds to the number 6 so we are shifting the letter 'W' by 6. With both methods we get the letter 'C'.
GOLDGOLDGOLDGOLDGOLDGOLDGOLDGOLDG
WEDONTGOTOAFRICATOSTEALNOCOCONUTS
C
We now do the same thing with the plaintext letter 'E' and the key letter 'O'. Using both methods we should get the letter 'S'.
GOLDGOLDGOLDGOLDGOLDGOLDGOLDGOLDG
WEDONTGOTOAFRICATOSTEALNOCOCONUTS
CS
D encrypted in a caesar cipher of shift L is O.
GOLDGOLDGOLDGOLDGOLDGOLDGOLDGOLDG
WEDONTGOTOAFRICATOSTEALNOCOCONUTS
CSO
We do the same thing for the rest of the message to get
CSORTHRRZCLIXWNDZCDWKOWQUQZFUBFWY
When decrypting this we use the same method except we shift backwards. Instead of using the whole vigenere square we can take out only the section we need to get this:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
GHIJKLMNOPQRSTUVWXYZABCDEF
OPQRSTUVWXYZABCDEFGHIJKLMN
LMNOPQRSTUVWXYZABCDEFGHIJK
DEFGHIJKLMNOPQRSTUVWXYZABC
For this table the row is the key and the column is the plaintext but it does not really matter.
Try decrypting this message. The key is WIRED.
epfthuwlhlzvfxmqakkrkocidrqxiqazvgllpvvgakicspmi
mkkxvcrqbimhzbfguwkbxkeatsgajpldjl
Next post we will see why frequency analysis does not work on the Vigenere cipher.