# The Vigenere Cipher and Square

The vigenere cipher (which is actually French "Vigenère", which sounds a bit like visionair) is a very old way of coding that's designed to mask character frequency (checking character frequency in a piece of coded text is one of the most well-known ways of breaking code).

The "vigenere cipher" is not an easy code, until you "get" how it works. Practice, practice, practice. The cipher works with a grid, called the "Vigenère Square", is a grid of 26 by 26 characters, where the letters of the alphabet are written, but shifted left one character as you go down.

I realize this is kind of technical, so here you can see what I mean:

## Vigenere Square

See how the alphabet is shifting to the left as you go down?

## How to use the Vigenere Cipher

First, you and your spy ring (fellow spies you communicate with) need to agree on a keyword or a key phrase, to code and decode the sentences that you send.

Say that you choose the word "ESPIONAGE". Now you and your fellow spies have both the Vigenere cipher square and the keyword, so you have what you need to code and decode sentences.

### Encoding

To see how it works, it's best to give it a try. So, let's code the sentence "MEET ME AFTER SCHOOL".

First, write out the sentence without the spaces in between, and write the keyword below it, repeating the characters until it's as long as the sentence you're encoding:

 M E E T M E A F T E R S C H O O L E S P I O N A G E E S P I O N A G

Then, for each combination, find the character that is on the intersection of the column (top character) and the row (bottom character). To get the coded character for the top letter (the first letter of the sentence "M") you go down the rows until you reach the row that has the bottom character (the first letter of the word ESPIONAGE, "E"). The character that's on the intersection is "Q".

 M E E T M E A F T E R S C H O O L E S P I O N A G E E S P I O N A G q

Ok, one more time. Top character is "E", bottom character is "S". Going down the column "E", until you reach row "S", you find the coded letter "W". And so on and so forth.

 M E E T M E A F T E R S C H O O L E S P I O N A G E E S P I O N A G q w t b a r a l x i j h k v b o r

The coded sentence is: QWTBA RALXI JHKVB OR (written down in blocks of 5 chars, a usual way of writing down coded messages).

### Decoding

Now what do you do when you receive that message? Well, it's more of the same, just the other way around.

Write the coded text, and below it the keyword, repeating as long as the coded text is.

 q w t b a r a l x i j h k v b o r E S P I O N A G E E S P I O N A G

Now, for each combination, do the following. Find the row for the bottom character. In our example, "E" (first letter of "ESPIONAGE"). Then look through that row until you find the character in the top row, in this case "q". Then go up to see the letter that is at the top of that column. The column that has the letter "q" is the "M" column.

Next character to look for is the letter "w" in the row "S". The letter "w" on that row can be found in the column "E".

And so on and so forth:

 q w t b a r a l x i j h k v b o r E S P I O N A G E E S P I O N A G M E E T M E A F T E R S C H O O L

## Some practice for you

Here is a coded message to practice the Vigenere cipher. The keyword to decode it with is "COMPLETE". Once you learned what the coded message means, do it!

TSOGF MMEIS ZIDJH VVCBH ACLIE FQID

(No need to contact me to let me know what it means... I already know what it means! ;-D)

Now, move along, and use this knowledge with discretion!

Go from Vigenere Cipher to Become a Spy

Go to Top Spy Secrets Homepage