Vigenere Cipher Decoder and Encoder
Enter your message, provide the key, and choose whether you want to encrypt plaintext or decrypt ciphertext.
Shortcuts: Ctrl + Enter decode · Ctrl + Shift + Enter encode
Reference matrix
Tabula recta
Cryptanalysis
Explore possible keys
Paste your ciphertext below. The tool uses frequency analysis (Index of Coincidence) to guess the most likely key for lengths 1–6, or specify an exact key length.
Cryptanalysis
Inspect letter frequencies
Analyze letter frequencies to identify patterns. English text peaks at E, T, A, O, I, N. A uniform distribution suggests strong encryption.
Session
Recent operations
Session history is stored in your browser for this visit.
No operations yet — encode or decode something to see history here.
What Is the Vigenere Cipher?
The Vigenere cipher is a polyalphabetic substitution cipher that encrypts letters using a key. Instead of applying one fixed substitution to every letter, it uses different Caesar-style shifts according to the letters of the key.
This makes it different from a Caesar cipher. A Caesar cipher applies the same shift throughout a message. If the shift is 3, every A becomes D, every B becomes E, and so on. The Vigenere cipher changes the shift as the key changes.
The main terms are simple:
- Plaintext is the original readable message.
- Ciphertext is the encrypted message.
- Key is the word or phrase controlling the substitutions.
- Encryption transforms plaintext into ciphertext.
- Decryption uses the key to transform ciphertext back into plaintext.
- Cryptanalysis attempts to recover information from ciphertext without being given the secret key.
The Vigenere cipher is called polyalphabetic because the effective substitution alphabet changes from one key position to another. A single plaintext letter can therefore encrypt to different ciphertext letters within the same message.
For example, the plaintext letter A encrypted with one key letter may produce D, while another occurrence of A encrypted under a different key letter may produce X. The plaintext letter has not changed. The shift applied to it has.
This is the central idea that separates Vigenere from a simple monoalphabetic substitution cipher.
The Vigenere square
The Vigenere square, also known as the Vigenere table or tabula recta, is a grid of shifted alphabets used to perform the cipher manually.
The top row contains the alphabet. Each following row shifts the alphabet by one position:
A B C D E F G H I J K L M ... A A B C D E F G H I J K L M ... B B C D E F G H I J K L M N ... C C D E F G H I J K L M N O ... ...
The exact operation can be performed visually with the table or mathematically using numbers from 0 through 25. The two methods represent the same cipher.
How Does the Vigenere Cipher Work?
The traditional Vigenere cipher can be understood as a sequence of Caesar shifts controlled by the key.
First, the letters are represented numerically:
C = (P + K) mod 26
For encryption, the plaintext value and corresponding key value are added modulo 26.
P = (C - K) mod 26
For decryption, the key value is subtracted from the ciphertext.
Here, P is the plaintext value, C is the ciphertext value, and K is the key value.
The important part is how the key is applied.
Suppose the key is:
If the message is longer than five letters, the key repeats:
LEMONLEMONLEMON...
This repeated sequence is the keystream for the traditional repeating-key Vigenere cipher.
ATTACK...
LEMONL...
The first plaintext letter, A, is combined with L. The next plaintext letter, T, is combined with E. The next is combined with M, and so forth.
So the first ciphertext letter is L.
For the second position:
The process continues across the message.
The Vigenere square provides the same result without requiring the user to perform the arithmetic manually.
Can a Vigenere Cipher Be Decoded Without the Key?
There are two very different situations.
CIPHERTEXT
+
KNOWN KEY
→
PLAINTEXT
This is ordinary decryption.
CIPHERTEXT
→
ANALYZE STRUCTURE
→
ESTIMATE KEY
→
RECOVER PLAINTEXT
This is cryptanalysis.
The traditional repeating-key Vigenere cipher can be vulnerable to this kind of analysis because the key eventually repeats. If a key has five letters, for example, the first, sixth, eleventh, sixteenth, and subsequent alphabetic positions use the same key position.
That repetition creates periodic structure.
A sufficiently long ciphertext can therefore contain statistical clues about the length of the key. Classical Vigenere cryptanalysis commonly approaches the problem by first estimating the keyword length and then separating the ciphertext into groups corresponding to individual key positions. Each group behaves like a Caesar cipher using one fixed shift.
Finding repeated patterns
One classical approach is the Kasiski examination.
The method looks for repeated sequences of letters in the ciphertext and measures the distances between their occurrences. When repeated plaintext material happens to align with the same positions of a repeating key, corresponding ciphertext sequences can also repeat.
If several distances share a common factor, that factor can provide evidence for a possible key length.
It is not a guarantee that every repeated sequence reveals the key length. Accidental repetitions can occur, and short ciphertexts may not provide enough evidence. Kasiski analysis is therefore better understood as a way to generate candidate key lengths rather than as a magic formula that always reveals the answer.
Estimating key length statistically
Another classical technique is the Index of Coincidence, often associated with William Friedman.
The measure looks at how frequently letters coincide within a sample of text. Different types of text and different cipher structures produce different statistical patterns.
For a Vigenere ciphertext, the Index of Coincidence can help determine whether the text behaves like a polyalphabetic cipher and can provide information useful for estimating the length of the repeating key.
Kasiski examination and Index of Coincidence therefore address closely related questions. Neither is the entire process of breaking Vigenere. They are methods for gaining information about the repeating key structure.
Separating the ciphertext by key position
Suppose analysis suggests that the key contains five letters.
Position 1, 6, 11, 16, ...
Position 2, 7, 12, 17, ...
Position 3, 8, 13, 18, ...
Position 4, 9, 14, 19, ...
Position 5, 10, 15, 20, ...
Every letter in one stream was encrypted using the same key position.
That means each stream effectively behaves like a Caesar cipher with one fixed shift.
Frequency analysis can then be applied to the individual streams. Once the likely shift for each stream is found, those shifts form a candidate key. The candidate key can then be tested against the complete ciphertext.
This is the central structural weakness of the traditional repeating-key Vigenere cipher: changing alphabets makes ordinary frequency analysis harder, but repeating the same sequence of shifts creates periodic structure that can eventually be separated and analyzed.
For a full technical treatment, our Vigenere cryptanalysis guide goes deeper into key-length estimation, Kasiski examination, Index of Coincidence, ciphertext grouping, frequency analysis, and key recovery.
Is the Vigenere Cipher Secure?
The Vigenere cipher was an important improvement over simple substitution systems because changing the substitution alphabet makes direct letter-frequency analysis much less effective.
That historical advantage should not be confused with modern security.
The traditional repeating-key Vigenere cipher is vulnerable because the key repeats. Once the periodic structure becomes visible, cryptanalysis can use the likely key length to separate the ciphertext into Caesar-like streams. Classical cryptanalysis sources describe exactly this transition from keyword-length recovery to frequency analysis of the resulting groups.
The amount of ciphertext also matters. A very short message may not contain enough statistical information for reliable analysis. A longer ciphertext gives an attacker more repeated structure and more letters from which to estimate statistical properties.
This does not make every short Vigenere ciphertext automatically impossible to solve, nor does it mean that every ciphertext reveals its key immediately. It means that repeating-key Vigenere does not provide the security expected from modern cryptographic systems.
Vigenere and the one-time pad
The one-time pad is fundamentally different from repeating-key Vigenere.
A properly constructed one-time pad uses a truly random key that is at least as long as the message, uses the key only once, and keeps the key secret. Under those conditions, the ciphertext does not provide the same kind of statistical information that a repeating short key does.
The important lesson is therefore not simply that “longer keys are better.” How the key is generated, how long it is, whether it repeats, and whether it is reused all affect the security properties of a cryptographic system.
Vigenere remains useful for learning these principles, but the traditional repeating-key cipher should not be used as modern protection for sensitive information.
History of the Vigenere Cipher
The name “Vigenere cipher” can make the history sound simpler than it really is.
The underlying idea belongs to a much longer development of polyalphabetic cryptography. Earlier cryptographers explored systems that used multiple alphabets rather than relying on one fixed substitution alphabet.
Polygraphia
Johannes Trithemius’s Polygraphia, published posthumously in 1518, included a system based on a changing sequence of alphabets and is an important part of this development.
A keyed polyalphabetic system
Giovan Battista Bellaso described an important keyed polyalphabetic system in the 16th century. His 1553 work La Cifra del Sig. Giovan Battista Bellaso described a system in which a keyword or countersign could be used to coordinate the use of different cipher alphabets.
Vigenere’s cryptographic work
Blaise de Vigenere later made major contributions to cryptography. In 1586 he published Traicté des chiffres ou secrètes manières d’escrire. His work included an autokey system as well as discussion of polyalphabetic techniques.
A complicated origin
The repeating-key system became associated with Vigenere’s name over time, even though the historical development was more complicated than the simple statement that Vigenere invented the entire system. This is why modern explanations should distinguish the history of the underlying technique from the origin of the name.
Difficult to break
The cipher subsequently acquired a reputation for being exceptionally difficult to break. That reputation lasted for centuries until systematic cryptanalysis exposed the weakness introduced by key repetition.
The weakness becomes visible
Charles Babbage developed a method for attacking repeating-key polyalphabetic ciphers, and Friedrich Kasiski later published a practical method for determining likely key lengths using repeated ciphertext sequences and their distances. Kasiski’s published work in the 19th century became an important milestone in the cryptanalysis of repeating-key ciphers.
The history is therefore closely connected to the technical weakness of the cipher itself: the same repeating key that made encryption more complicated than a simple Caesar cipher eventually provided the periodic structure that cryptanalysts could exploit.
For the full historical account, see our detailed history of the Vigenere cipher.
Vigenere Cipher Variants and Related Ciphers
The Vigenere cipher belongs to a broader family of classical cryptographic systems that use related alphabet-shifting ideas but do not necessarily perform the same transformation.
Beaufort
Beaufort uses a different mathematical relationship between the key, plaintext, and ciphertext. Although its table-based presentation can look similar to Vigenere, it is a different cipher.
Variant Beaufort
Variant Beaufort is another closely related construction with its own transformation rule.
Autokey
Autokey changes the way the keying sequence is generated. Traditional repeating-key Vigenere repeatedly cycles the same keyword. Autokey extends the keying material using message material instead of simply repeating the original short keyword.
This distinction is particularly important historically because Vigenere’s own cryptographic work included an autokey method, while the repeating-key system commonly called the Vigenere cipher developed from earlier polyalphabetic work.
These ciphers can therefore belong to the same historical family without being interchangeable algorithms.
Vigenere Cipher Frequently Asked Questions
Clear answers to common questions about the cipher, its key, decryption, security, and related systems.
Is the Vigenere cipher encryption or encoding?
The Vigenere cipher is an encryption method. Encryption transforms plaintext into ciphertext using a key. Encoding generally changes the representation of information without being intended to provide cryptographic secrecy.
What is a Vigenere key?
A Vigenere key is the word or phrase used to determine the shift applied at each position of the message. In the traditional repeating-key system, the key is repeated when the message is longer than the key.
How do you decrypt a Vigenere cipher?
When the key is known, decryption reverses the encryption operation. Using the numerical representation A=0 through Z=25, the key value is subtracted from the ciphertext value modulo 26.
Can you decrypt a Vigenere cipher without the key?
Not through ordinary key-based decryption, because that process requires the key. However, a sufficiently long repeating-key Vigenere ciphertext can be subjected to cryptanalysis to estimate the key length and potentially recover the key.
Can a Vigenere cipher be broken?
The traditional repeating-key Vigenere cipher is vulnerable to classical cryptanalysis. Kasiski examination, Index of Coincidence, and frequency analysis can be combined to exploit the periodic structure created by the repeating key.
What is the Vigenere square?
The Vigenere square is a table containing shifted versions of the alphabet. It provides a visual method for performing Vigenere encryption and decryption.
How is Vigenere different from the Caesar cipher?
Caesar uses one fixed shift for the entire message. Vigenere uses a key to control a sequence of shifts, so different positions can use different substitution alphabets.
Is the Vigenere cipher secure?
Traditional repeating-key Vigenere is not considered secure by modern cryptographic standards. Its repeating key creates periodic structure that can be exploited by cryptanalysis.
Who invented the Vigenere cipher?
The historical answer is more complicated than attributing the complete system to one person. Earlier cryptographers developed related polyalphabetic systems, Bellaso described an important keyed system in the 16th century, and Blaise de Vigenere later published influential cryptographic work that included an autokey method. The repeating-key cipher eventually became known by Vigenere’s name.
What is the difference between Vigenere and Autokey?
Traditional Vigenere repeatedly cycles a keyword. Autokey extends its keying sequence with message material rather than simply repeating the original keyword. The two therefore have different key structures and cryptanalytic properties.
What is the difference between Vigenere and Beaufort?
They use different mathematical transformations even though both are related classical polyalphabetic ciphers. A Vigenere decoder should not automatically be assumed to decode Beaufort ciphertext correctly.
