How Does a Vigenère Cipher Work? A Guide to Encoding and Decoding Secret Messages
Do you want to write a secret message? Would you like to break an old encoded text built with the famous Vigenère cipher? Or you are asking yourself, "How does a Vigenère cipher work?". Well, you're in the right place. We will provide an overview of the history of this famous method for encoding and decoding messages, as well as its working principles.
Essentially, the Vigenère cipher utilizes a key to encrypt/decrypt messages. Each letter of the key determines how many positions you need to shift each corresponding letter in the plaintext or in the ciphertext. The key can have a lower, equal, or larger number of letters than the text. If the key has fewer letters than the text, you must repeat it until it covers all the text letters. So, a critical element in writing your secret code or deciphering the cipher is the key.
If you would like to create your own encoded message instantaneously or to decode a ciphertext, you can access our excellent Vigenère cipher calculator.
However, if you want to know more details about the Vigenère cipher, stay with us in this article, where we will explore the following subjects:
- What is the Vigenère cipher?
- How does a Vigenère cipher work?
- How to solve the Vigenère cipher with a Vigenère table.
- How does the Union army decipher the Vigenère cipher?
- What makes the Vigenère cipher stronger than the Caesar cipher?
- What is the present theoretically unbreakable cipher?
- And much more.
So, let's start to unveil the secrets behind the cipher.
Nowadays, we are facing a new era of cryptography with the advent of quantum computers and AI. The necessity of new ways to protect information, such as emails, private messages, and financial transactions, is becoming increasingly important as all our daily interactions are part of the digital world. Among the oldest mechanisms for encoding messages are ciphers, and among them, we can highlight the Vigenère cipher.
The Vigenère cipher is a classic method of encrypting text that was considered unbreakable for centuries. It was used in the American Civil War by the leaders and senior officers of the Confederate States of America for sending secret correspondence.
The Vigenère cipher is based on a method of encryption known as polyalphabetic, which means it substitutes multiple alphabets to encode a message. It appeared for the first time in 1553 in Giovan Battista Bellaso's book La cifra ("The Cipher"). However, it became notorious in 1585 after the book Traité des chiffres ou secrètes manières d'écrire by Blaise de Vigenère.
🙋 Are you looking for additional resources on cryptography? Then access our Morse code calculator and write your own secret message.
As we mentioned earlier, the concept behind the Vigenère cipher is to have a key to shift the plaintext into the ciphertext or vice versa.
However, the question is, how much does the key shift each plaintext/ciphertext letter? To answer this question, we must transform each letter of the alphabet into a numerical code. This is done by considering that A=0;B=1;C=2;...,Z=25.
Thus, if you want to encode a message with a Vigenère cipher, the formula to make it is:
where:
- Ci — Ciphertext letter number;
- Pi — Plaintext letter number;
- Ki — Key letter number; and
- mod — Modulo operator.
This equation means that the sum between Pi and Ki needs to be lower than 26 (mod26), otherwise, you need to subtract 26 from the sum to get the correct encoded letter. Learn more about the modulo operator by checking out our modulo calculator.
Now that you know how to encode with the cipher, we will show you how to decrypt it. The procedure is simple; as you may think, you just need to reverse the encryption process. In order to do that, you also need the cipher key. The formula of the Vigenère cipher decoder is:
And one more time, the result of this equation is modulated by the number 26.
If you have your ciphertext but do not have the key, then it may be impossible to decipher the Vigenère cipher. There are methods to solve it if the key repeats, such as the Kasiski's pattern analysis or Friedman's statistical methods. Other interesting alternatives include using modern brute-force computational methods if the key is short or a dictionary word.
Now that you understand the answer to "How does a Vigenère cipher work?", let us introduce you to the Vigenère table.
The Vigenère table is a popular method for visualizing and solving the Vigenère cipher. This table, also known as Vigenère square or tabula recta, is a 26 × 26 grid used to encrypt and decrypt text in the Vigenère cipher. A standard version of the table is presented below:
![]() |
|---|
In order to make an example, let's show you how to encrypt the word "CALCULATOR" with the key "OMNI". Then, by following the recipe described in the last section, we will match each letter of plaintext with the letters of the key, meaning that:
Now, we can combine each pair of letters in the Vigenère table by taking each plaintext and key letter in the table's first row and first column, respectively. The intersection between the previous letters gives the ciphertext letter. We can see the encryption process for the first three letters of the ciphertext in the following figures:
![]() |
|---|
![]() |
|---|
![]() |
|---|
So, you just need to repeat this procedure to find out that the corresponding ciphertext is "QMYKIXNBCD". Feel free to check this result with our Vigenère cipher calculator.
The Vigenère cipher was used by the Confederate army during the American Civil War to send secret messages. The Union army broke these ciphertexts by noticing that they used only three keys throughout the war: COMPLETE VICTORY, MANCHESTER BLUFF, and COME RETRIBUTION. Moreover, the Confederate used to encipher just part of a plaintext, enabling cryptanalysts to understand its context.
The Vigenère cipher employs a polyalphabetic encryption method, which combines multiple alphabets throughout a single keyword. The Caesar is an example of a monoalphabetic cipher, where a fixed number of positions shifts the letters of a single alphabet. Therefore, the Caesar cipher has only 25 possible keys, while the Vigenère cipher has (26ⁿ) possible keys, where n is the length of the key.
In 2025, the unbreakable cipher is known as the one-time pad. This encryption method is based on a random, single-use, pre-shared key that is at least as large as the size of the message being sent. Thus, the plaintext is paired with this secret key, in such a way that every bit or character of the plaintext is encrypted by combining it with the corresponding bit or character from the key, using modular addition.
This article was written by João Rafael Lucio dos Santos and reviewed by Steven Wooding.



