Symmetric Keys

Caesar Cypher

One of the simplest methods of encrypting plain text is that invented by Julius Caesar to communicate with his generals in the battlefield.

Each letter in a plain text message is simply offset by a fixed number of places in the alphabet.

For example if the plain text “COME HOME MEN” is encrypted with an offset of 3, the cypher text reads “FRPH KRPH PHQ“.

If when a letter is offset, it goes beyond the letter Z, we loop back around the alphabet. So, for example, when the plain text “MY TOYS” is encrypted with an offset of 3, the cypher text produced is “PB WRBV“.

In order to decrypt the cypher text, all you need to know is the offset value.

Of course the Caesar Cypher is not particularly secure. It can be cracked by brute force; just keep trying different values for the offset until you get something meaningful. You can also perform a frequency analysis on the cypher text, based on the knowledge the letter E is the most often use letter of the alphabet, followed by T, etc.

Vigenère Cypher

A more secure way of encrypting plain text is that attributed to the French alchemist Blaise de Vigenère.

In this system, a keyword is used to determine different offset values for the letters in the plain text.

For example, the plain text “DO NOT READ THIS” when encrypted with the keyword “SECRET” produces the cypher text “WT QGY LXFG LMCL“.

The first letter in the keyword, S, is the 19th letter of the alphabet, so the first letter of the plain text, D, is offset by 19 letters. The second letter in the keyword, E, is the 5th letter of the alphabet, so the second letter of the plain text, O, is offset by 5 letters, etc. In this case the keyword is only 6 characters long, so the 7th letter of the plain text is encrypted with an offset given by the letter S again.

Of course, in order to decrypt the cypher text, you need to know the keyword.

You should be able to see that that a longer keyword will result in cypher text that is less easy to crack with frequency analysis.

Symmetric Key Cryptography

Both the Caesar Cypher and the Vigenère Cypher each rely on a symmetric key. You use the same key to decrypt the message as you did to encrypt it.

There are of course much more complex ways that a symmetric key can be used to jumble up some plaintext, and the same key could be applied multiple times to add complexity. But, at the end of the day, you can decipher some cypher text by reversing the process that was used to produce it, if you know the key and how it was applied.