Detective Society Logo White and Blue

Vigenere Cipher

A Vigenere Cipher is a cipher which is encrypted using a key, and which can only be decoded by using a Vigenere Square.

This is a Vigenere Square:

Encoding

To encode a message, you write the message out first, with the key phrase beneath it as in the example below:

HELLOANNE
IAMTHEKEY

You then use the square to encode it, by looking at the where the letters from the message (read along the top of the square) intersect the letters from the key (read along the side of the square).

So for the first letter we would look to see where the H intersects with the I

This gives us the letter P.

If we continue that with the rest of the example, we would encoded message like this:

HELLOANNE
IAMTHEKEY
PEXEVEXRC

As is the case with most keys, if the key is shorter than the message you just start writing the key out again from the beginning:

HELLOALESSANDRO
IAMTHEKEYIAMTHE

Decoding

To decode a message, we of course have to work backwards. Decoding a Vigenere cipher without the key is very difficult - you first need to find the length of the key, before identifying what the key is and then finally deciphering the message. Because it is so difficult, your best bet is to try and work out what the key is in other ways. Look for words or phrases that are underlined, or stand out in other ways.

Let us assume that we have discovered the key is IAMTHEKEY and the encoded message is LEOBWLOVKM.

To find out the decoded message, it helps to write them out as follows:

??????????
IAMTHEKEYI
LEOBWLOVKM

We then use the Vigenere square to decipher the message. We’re going to work backwards from the method we used to encode the message. 

For the first letter we look at the ‘I’ row on the square and find the letter ‘L’. We then need to look at the column that ‘L’ is in. We can see that it’s in the ‘D’ column, which means the first letter is ‘D’.

For the second letter we look at the ‘A’ row and find the letter ‘E’, this gives us the letter ‘E’.

By carrying on this way, we get the message:

DECIPHERME

To make life easier when decoding Vigenere ciphers you can find many different online tools that will decode them automatically, so long as you can provide both the encoded message and the key.