Omni Calculator logo

Vigenère Cipher Calculator

The Vigenère cipher calculator enables you to decrypt/encrypt any text using the famous Vigenère polyalphabetic encryption method. In this article, you will see this cipher's history and the methods it applies to encode/decode texts.

Moreover, along with this tool, we will approach the following subjects:

  • What is the Vigenère cipher?
  • How to use a Vigenère cipher — The Vigenère cipher encoder.
  • How to decrypt a Vigenère cipher? The Vigenère cipher decoder.
  • The Vigenère table.
  • How to use the Vigenère cipher calculator.
  • How does a Vigenère cipher work?
  • Is it possible to decode the Vigenère cipher without the key​?
  • Who invented the Vigenère cipher​?
  • How can I encrypt a text using the Vigenère cipher?
  • And much more.

Are you interested in the cipher's extreme details? Then access our dedicated articles on it: "How does a Vigenère cipher work​?" and "Polyalphabetic cipher​."

Now, keep with us and let's find the secrets behind the Vigenère cipher.

What is the Vigenère cipher?

The Vigenère cipher is a classic method of encrypting text that was considered unbreakable for centuries. This type of encryption is known as polyalphabetic, which means it is based on substituting multiple alphabets to encode a message.

This cipher 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.

The Vigenère cipher uses 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. 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 plaintext letters.

Therefore, if you want to decipher the Vigenère cipher, you need to know this key.

🙋 If you are looking for other text encoding tools, check out our Morse code calculator.

How to use a Vigenère cipher — the Vigenère cipher encoder

But the question is, how much does the key shift each plaintext 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=25A = 0;\, B = 1;\, C=2;\,\mathrm{...}\,Z=25.

Thus, the formula to encode a message with the Vigenère cipher is given by the equation below:

Ci=(Pi+Ki)mod26C_i = \left(P_i+K_i\right) \,\mathrm{mod}\, 26

where:

  • CiC_i — Ciphertext letter number;
  • PiP_i — Plaintext letter number;
  • KiK_i — Key letter number; and
  • mod\mathrm{mod} — Modulo operator.

The equation above means that the sum between PiP_i and KiK_i needs to be lower than 2626 (mod26\mathrm{mod}\,\, 26), otherwise, you need to subtract 2626 from the sum to get the correct encoded letter. You can learn more about the modulo operator with our modulo operator calculator and modulo calculator.

Let's make an example to show you how easy it is to encode a message with the Vigenère cipher. Suppose your plaintext is "HELLO" and your key is the word "KEY". Then we need to match each letter of plaintext with the letters of the key by repeating the last, which means that:

HKEELYLKOE\begin{gather*}\rm H \\[-2px]\rm K \end{gather*} \,\, \begin{gather*}\rm E\\[-2px]\rm E \end{gather*} \,\, \begin{gather*}\rm L\\[-2px]\rm Y\end{gather*}\,\, \begin{gather*}\rm L\\[-2px]\rm K\end{gather*}\,\, \begin{gather*}\rm O\\[-2px]\rm E\end{gather*}

Now, we can write the corresponding number for each letter in the pairs and add them. For instance, H=10H = 10 and K=7K = 7, then the sum is 1717, and the ciphertext letter is RR. By repeating this procedure, we find the encoded ciphertext:

HK17REE8ILY9JLK21VOE18S\begin{gather*}\rm H \\[-2px]\rm K \\[-2px]\rm 17 \\[-2px]\rm R \end{gather*}\,\, \begin{gather*}\rm E\\[-2px]\rm E \\[-2px]\rm 8 \\[-2px]\rm I \end{gather*} \,\, \begin{gather*}\rm L\\[-2px]\rm Y \\[-2px]\rm 9 \\[-2px]\rm J \end{gather*}\,\, \begin{gather*}\rm L\\[-2px]\rm K \\[-2px]\rm 21 \\[-2px]\rm V \end{gather*}\,\, \begin{gather*}\rm O\\[-2px]\rm E \\[-2px]\rm 18 \\[-2px]\rm S \end{gather*}

So, the code for "HELLO" is "RIJVS".

How to decrypt a Vigenère cipher — the Vigenère cipher decoder

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 key. The formula of the Vigenère cipher decoder is:

Pi=(KiCi)mod26P_i = \left(K_i-C_i\right) \,\mathrm{mod}\, 26

As we saw in the previous section, the result of this equation is modulated by the number 2626. Let's use our last example. Our cipher code is "RIJVS", and the keyword is "KEY". So, we will match each letter of the cipher code with the letters of the key:

RKIEJYVKSE\begin{gather*}\rm R \\[-2px]\rm K \end{gather*} \,\, \begin{gather*}\rm I\\[-2px]\rm E \end{gather*} \,\, \begin{gather*}\rm J\\[-2px]\rm Y\end{gather*}\,\, \begin{gather*}\rm V\\[-2px]\rm K\end{gather*}\,\, \begin{gather*}\rm S\\[-2px]\rm E\end{gather*}

Then, we write the corresponding number for each letter in the pairs and subtract them. For instance, in position three we have J=9J = 9 and Y=24Y = 24, whose difference is 15-15. Since the result is negative, we need to subtract it from 2626, obtaining 1111. Thus, the plaintext letter is LL. By repeating this procedure, we recover the plaintext "HELLO":

RK7HIE4EJY11LVK11LSE14O\begin{gather*}\rm R \\[-2px]\rm K \\[-2px]\rm 7 \\[-2px]\rm H \end{gather*}\,\, \begin{gather*}\rm I\\[-2px]\rm E \\[-2px]\rm 4 \\[-2px]\rm E \end{gather*} \,\, \begin{gather*}\rm J\\[-2px]\rm Y \\[-2px]\rm 11 \\[-2px]\rm L \end{gather*}\,\, \begin{gather*}\rm V\\[-2px]\rm K \\[-2px]\rm 11 \\[-2px]\rm L \end{gather*}\,\, \begin{gather*}\rm S\\[-2px]\rm E \\[-2px]\rm 14 \\[-2px]\rm O \end{gather*}

🙋 Would you like to decrypt the cipher without knowing the key? Then access our articles "How to decode the Vigenère cipher without a key​" and "Kasiski examination​".

The Vigenère table

The Vigenère 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. Therefore, the table is an alternative way to visualize how the encryption/decryption method works. You can see the table in detail in the figure below:

The Vigerene table, containing a 26 x 26 grid with the letters of the alphabet.

Let's show you how the table works with an example. Suppose you want to encrypt the word "CALCULATOR" and your key is "OMNI". Then, by following the procedures of the last section, we will match each letter of plaintext with the letters of the key, meaning that:

COAMLNCIUOLMANTIOORM\begin{gather*}\rm C \\[-2px]\rm O \end{gather*} \,\, \begin{gather*}\rm A\\[-2px]\rm M \end{gather*} \,\, \begin{gather*}\rm L\\[-2px]\rm N\end{gather*}\,\, \begin{gather*}\rm C\\[-2px]\rm I\end{gather*}\,\, \begin{gather*}\rm U\\[-2px]\rm O\end{gather*}\,\, \begin{gather*}\rm L\\[-2px]\rm M\end{gather*}\,\, \begin{gather*}\rm A\\[-2px]\rm N\end{gather*}\,\, \begin{gather*}\rm T\\[-2px]\rm I\end{gather*}\,\, \begin{gather*}\rm O\\[-2px]\rm O\end{gather*}\,\, \begin{gather*}\rm R\\[-2px]\rm M\end{gather*}

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:

The Vigerene table showing the intersection of letters C and O.The Vigerene table showing the intersection of letters A and M.The Vigerene table showing the intersection of letters L and N.

Therefore, by repeating this procedure, we find that the ciphertext is "QMYKIXNBCD".

How to use the Vigenère cipher calculator

We know that it was a lot about encrypting messages and the features of the Vigenère cipher. So, if you want to skip all the complicated processes and quickly write your secret message, you can use our cipher machine.

The Vigenère cipher calculator is an intuitive and easy tool to use. You just need to input your text. It can be a plaintext or a ciphertext, depending on whether you want to use a Vigenère cipher encoder or a Vigenère cipher decoder. After that, you need to type the key of your Vigenère cipher and enjoy your result.

FAQs

How does a Vigenère cipher work?

The Vigenère cipher uses a polyalphabetic encryption method. Thus, the letters of the ciphertext (Ci) are built by replacing each letter of the plaintext (Pi) with a different shift, depending on the letters of a repeating key (Ki). The values of the letters follow the pattern: A=0, B=1, ...., Z=25. The mechanism to encode and decode a text is based on the following equations:

Ci = Pi + Ki mod 26

Pi = Ki - Ci mod 26

Is it possible to decode Vigenère cipher without key​?

No, you can't decipher the Vigenère cipher without the key. But suppose you have an encrypted message and want to decode it without knowing the key beforehand. In that case, you can use some methods to discover it, such as Kasiski's pattern analysis or Friedman's statistical methods, followed by frequency analysis. These methods only work if the key repeats in the encrypting procedure. You can also use modern brute-force computational methods if the key is short or a dictionary word.

Who invented the Vigenère cipher​?

The cipher was named after Blaise de Vigenère, but it was actually invented by Giovan Battista Bellaso in 1553. This cipher appeared first in Bellaso's book La cifra del Sig. However, it became notorious after the publication of Traité des chiffres ou secrètes manières d'écrire written by Vigenère. There, he describes an advanced cipher based on a keyword that combines with the plaintext itself, which was wrongly named as his original cipher.

How can I encrypt a text using the Vigenère cipher?

If you want to encrypt the text "WORLD" with the key "EARTH", you need to follow the steps below:

  1. Take the corresponding numbers for each letter of the text and of the key:

    W = 22; O = 14; R = 17; L = 11; D =3
    E = 4; A = 0; R = 17; T = 19; H = 7

  2. Sum each pair of letters formed by plaintext and the key. Each sum needs to have modulo 26:

    0; 14; 8; 4; 10

  3. Write the encoded text corresponding to each one of the previous results:

    AOIEK

  4. Or you can simply use our Vigenère cipher calculator.

Input the message to encode and the key.

Did we solve your problem today?

Check out 34 similar tech and electronics calculators 💻

3D printing cost

Amdahl's law

Battery capacity