Vigenère cipher online – encoder/decoder

Vigenère cipher encoder and decoder online. Use a keyword, study the table and examples, and learn how the Kasiski test finds key length.

How was the “unbreakable cipher” broken?

What is the Vigenère cipher?

The Vigenère cipher is a polyalphabetic cipher: every letter of the message is shifted by the value of the next letter of a keyword. Instead of the single shift used by Caesar, it applies as many different shifts as the key has letters.

How does the keyword work?

Write the key above the message and repeat it until the text ends. Each key letter selects a shift: A means 0, B means 1 and Z means 25. The same plaintext letter can therefore produce different ciphertext letters.

Example with the key REBUS

The message “ENIGMA” with the key “REBUS” becomes “VRJAER”. The key repeats above the text as R-E-B-U-S-R, so E+R→V, N+E→R, I+B→J, G+U→A, M+S→E and A+R→R. You can reproduce this example with the working tool above.

Complete shift table for key letters

The top row shows the key letter and the bottom row the shift it selects. The table uses the 26-letter Latin alphabet supported by the tool.

Key letters and the shifts they select
Key letterABCDEFGHIJKLMNOPQRSTUVWXYZ
Shift012345678910111213141516171819202122232425
How do you decrypt the text?

Decryption subtracts the same shifts. Write the key above the ciphertext and move every letter back by the value of its key letter; moving before A wraps around to the end of the alphabet. Without the key the step cannot be completed.

Vigenère and the Caesar cipher

A one-letter key turns Vigenère into an ordinary Caesar cipher, because every letter receives the same shift. The longer and less regular the key, the more it flattens the letter frequencies. A random key as long as the message and used only once is already a one-time pad.

See also: Caesar cipher

How can the Vigenère cipher be broken?

The first step is finding the key length: the Kasiski examination measures the distance between repeated fragments of the ciphertext, and the Friedman test uses the index of coincidence. Once the length is known, the text splits into columns, each of which is a plain Caesar cipher open to frequency analysis.

Why is the Vigenère cipher insecure?

A short key repeats many times, so regular patterns survive in the ciphertext. A computer tests hundreds of key lengths in a fraction of a second and, given enough text, recovers the keyword itself. The method is a teaching tool, not data protection.

History of the Vigenère cipher

The idea of several alphabets was developed by Leon Battista Alberti, Johannes Trithemius and Giovan Battista Bellaso, whose 1553 version is closest to today’s cipher. The name nevertheless commemorates Blaise de Vigenère. In the nineteenth century the method was called “the indecipherable cipher” until Charles Babbage and Friedrich Kasiski showed how to analyse it.

Vigenère table to print

The A4 worksheet includes a full tabula recta, encryption and decryption instructions, a worked example and space for your own message.