Vigenère cipher
Share this post
You might remember the Vigenère cipher from the earlier step about the history of encryption. It is a polyalphabetic cipher that uses multiple shifts to encrypt a message. In this step, you are going to look at how the extra complexity in the Vigenère cipher helped make it a much more robust encryption scheme than the Caesar cipher.
The encryption process
To encrypt a message, you need to choose a key and use a Vigenère square.
The key is a string of letters. A Vigenère square is a grid formed by repeatedly writing the alphabet, starting at different places.
To encrypt a message, you will replace each letter in the message with another letter, chosen by finding the intersection of the correct row and column. To choose the row, find the letter of your message in the first column. If your message was “hello”, the first letter would be encrypted using the row beginning with the letter ‘h’.
To choose the correct column, you need your key. For the first letter in your message, choose the column that starts with the first letter in the key; for the second letter in your message, choose the column that starts with the second letter of your key, and so on. For instance, if your key was “RPI”, the first letter in the message would be encrypted using the column beginning with the letter ‘R’, the second letter would be encrypted using the column beginning with the letter ‘P’, and the third using the column beginning with the letter ‘I’. If the message is longer than your key, simply reuse the letters in your key in order.
Using this process, the letter ‘h’ is encrypted as ‘y’, and the letter ‘e’ is encrypted as ‘t’. The first ‘l’ also becomes ‘t’, but the second ‘l’ becomes ‘c’. Finally, the letter ‘o’ becomes ‘d’. This encrypts the word “hello” as “yttcd”.
To test your understanding of the method, encrypt the following message:
I am encrypting a message
To decrypt a message, you reverse the process by first finding the row that corresponds to the current letter in the key, then looking along that row until you find the corresponding letter in the ciphertext. The letter at the top of this column is the plaintext letter.
To decrypt the ciphertext “yttcd”, start at column ‘R’ and find the position of the letter ‘y’ in this column. At the start of this row is the letter ‘h’ — the first letter of the plaintext. Just like in the encryption process, when you get to the end of the key, you wrap around and use the first letter again.
Measuring the complexity of the Vigenère cipher
This encryption method is certainly more complex than the Caesar cipher that you looked at earlier. To assess how secure the Vigenère cipher is, consider the key areas that you were introduced to in the previous step.
Key length
The key in a Vigenère cipher can vary in length from two characters to the length of the plaintext. The longer the key is and the more random it is, the harder the scheme is to crack. With short keys, you are likely to encrypt similar words or parts of words in the plaintext with the same part of the key, giving an attacker some clues as to what the key might be.
Algorithmic complexity
The encryption and decryption algorithms require multiple steps for each character. These extra steps mean that it will take an attacker longer to test their guesses at the key. For each character in the plaintext, there are many more permutations to try, adding more steps and more complexity.
Methods of attack
In this area, the Vigenère cipher really shines. You saw in an earlier step that monoalphabetic substitution ciphers are vulnerable to frequency and pattern analysis, because they preserve patterns in the plaintext. Polyalphabetic ciphers do not suffer from the same weaknesses. The number of places that a letter is shifted in the alphabet can change for each letter in the message, which means that the most frequently used letter in the ciphertext does not correspond to the most frequently used letter in the plaintext.
It is not unbreakable, however, and there are still some patterns that can give an attacker clues as to what your key is. If the same pattern appears in the ciphertext multiple times, it can indicate the same word being encrypted with the same part of the key.
Your turn
I would like you to practise using the Vigenère cipher to decrypt a message.
The following ciphertext has been encrypted with the key “polyalphabetic”:
“Lvlr yppy wbw mpg Kwrcnpgl cjtamt uwyylwn jrbgdmf, tbognr xa’s sibop pg efe fcirfedidas ngpsty?”
Post only your answer to the question that the message poses in the comments section below, so that you don’t give the plaintext away to other learners.
Share this post
Introduction to Encryption and Cryptography

Introduction to Encryption and Cryptography

Reach your personal and professional goals
Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.
Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.
Register to receive updates
-
Create an account to receive our newsletter, course recommendations and promotions.
Register for free