The Vigenère Cipher
The Vigenère Cipher, created in the 16th century, uses an element not found in a Caesar Cipher: a secret key. The creator of the code picks any word or combination of letters at random to be the key, for example, “DOG.” The keyword chosen will then be matched to the plaintext message that you want to encrypt, for example, “ATTACK.” You can see that the keyword “dog” is shorter than the word “attack” by three letters. In this case, repeat your key until it matches the number of letters in your plaintext message. In this case, you would then have “DOGDOG.
Now, you will be able to create the ciphertext. To do this, you will need to use the chart below.
The columns are the letters of the secret key, while the rows are the letters of the plaintext message. So for our example, the first letter of our key is “D,” while the first letter of our plaintext word is “A.” So, find where they intersect on the chart, and you will find the first letter of our ciphertext, which is “D.” Next, the second letters of our key and plaintext words are “O” and “T” respectively. They intersect at “H.” You would continue this until you complete all six letters.
Plaintext Message: ATTACK
Cryptanalysis: Cracking a Vigenère Cipher
Because of the use of a key, the Vigenère Cipher cannot initially be cracked by using a simple frequency analysis like you could do with a Caesar Cipher. Though, the main weakness of a Vigenère Cipher is the repeating of the key. So, in our example, “dog” was repeated twice in order to match the number of letters in the word “attack.” If an attacker guesses the key’s length, it becomes much easier to crack. The ciphertext is then treated like a series of small Caesar Ciphers, and a method such as frequency analysis could then be performed to crack the code.
But how can an attacker guess the length of the key? There are actually two methods: the Kasiski examination and the Friedman test. If the attacker notices that there are repeated segments of text in the ciphertext, a Kasiski examination would be effective in cracking the code. The attacker would count the distance of letters between repeated text to get a good idea of how long the key is. The Friedman test takes an algebraic approach utilizing a formula to measure the unevenness of the cipher letter frequencies to break the cipher. The longer the text, the more accurate this technique is.
Read More on the History of Cryptography