Vigenère cipher: how it works
How to encrypt and decrypt with the Vigenère cipher using the square table and the repeated keyword.
- 01
Choose the key
Sender and recipient agree on a word, for example CIPHER.
- 02
Repeat it under the message
The key is written under the plaintext, repeated until it covers it all.
- 03
Use the table
For each letter, look at the row of the key letter and the column of the plaintext letter: the cipher letter is at the intersection.
- 04
Or count
Equivalently, shift the plaintext letter forward by as many positions as the key letter is worth: A shifts by 0, B by 1, C by 2 and so on.
- 05
Decrypt
The recipient does the reverse: shifts each ciphertext letter backwards according to the key.
The square table
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
A A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
… each row is shifted one position relative to the previous oneVigenère cipher: worked example
Step-by-step encryption of the message “meet me at the bridge” with the key CIPHER, letter by letter.
The pages of this topic
Back to the overviewVigenère cipher: history
From Alberti to Trithemius, from Bellaso to Vigenère: how the “indecipherable” cipher was born, why it bears the wrong name and how it was broken in the nineteenth century.
Vigenère cipher: the maths
The formulas of the Vigenère cipher in modular arithmetic, the key space and why the repetition of the key is its weakness.
Vigenère cipher: weaknesses and attacks
The Kasiski method, Friedman’s index of coincidence and column-by-column frequency analysis: how the Vigenère cipher is broken.
The Vigenère cipher today
Where the Vigenère cipher is found today: teaching, games, puzzles, and the lessons it left to modern cryptography.
Vigenère cipher: try it yourself
Encryption and decryption exercises with the Vigenère cipher, with solutions.
Vigenère cipher: frequently asked questions
Short answers to the most common questions about the Vigenère cipher.