How to use the Vigenère cipher tool
- Type your message in the box and a Keyword under it. The keyword can be any word; only its letters count.
- The coded message appears as you type. Press Copy to paste it anywhere.
- To decode, press the arrows between the two labels, paste the coded message and type the same keyword.
Capital letters stay capital, and anything that is not a letter A to Z stays as it is.
How the Vigenère cipher works
Take the classic example from Wikipedia: the message ATTACK AT DAWN and the keyword LEMON. Write the keyword again and again under the letters of the message:
- Message: A T T A C K A T D A W N
- Keyword: L E M O N L E M O N L E
- Coded: L X F O P V E F R N H R
Each keyword letter is a Caesar shift. L is 11 places from A, so the first A moves 11 places to L. E is 4, so T moves to X. M is 12, so the next T moves to F. Decoding moves each letter back by the same amount.
The same plain letter can turn into different coded letters, and the two As at the start of ATTACK become L and O. That is what makes Vigenère much harder to break than a simple substitution cipher: counting the most common letter no longer points straight to E.
The Vigenère square
Before computers, people used a table called the tabula recta: 26 rows of the alphabet, each one shifted one place further than the row above. To encode, find the column of the message letter and the row of the keyword letter; the letter where they cross is the coded letter. The translator above does the same lookup for every letter.
History of the Vigenère cipher
The cipher was first described by Giovan Battista Bellaso in 1553. It is named after Blaise de Vigenère, a French diplomat, because in the 19th century it was wrongly credited to him. Vigenère described a related but stronger cipher in 1586.
For about 300 years it had a reputation as le chiffre indéchiffrable, the indecipherable cipher. Charles Babbage broke it in the 1850s without publishing, and Friedrich Kasiski published a general method in 1863. Both relied on the keyword repeating: repeated pieces of the message coded with the same part of the keyword give repeated pieces of cipher text, and the gaps between them reveal the keyword length.
For a single shift with no keyword, use the Caesar cipher decoder, which also tries every shift for you.