Vigenère cipher: worked example
Step-by-step encryption of the message “meet me at the bridge” with the key CIPHER, letter by letter.
Let us encrypt the message MEET ME AT THE BRIDGE, without spaces, with the key CIPHER.
Text M E E T M E A T T H E B R I D G E
Key C I P H E R C I P H E R C I P H E
Ciphertext O M T A Q V C B I O I S T Q S N ILetter by letter
- 01
M + C
M is letter number 12 (counting A = 0); C is worth 2: 12 + 2 = 14, that is O.
- 02
E + I
4 + 8 = 12, that is M.
- 03
E + P
4 + 15 = 19, that is T.
- 04
T + H
19 + 7 = 26; past 25 you start again from the beginning: 26 − 26 = 0, that is A.
- 05
And so on
Up to the last letter, E + E = 4 + 4 = 8, that is I.
What stands out
The letter E appears five times in the message and becomes M, T, V and I. It is the fundamental difference from the Caesar cipher: the plaintext’s letter frequencies are no longer directly reflected in the ciphertext.
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.
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: how it works
How to encrypt and decrypt with the Vigenère cipher using the square table and the repeated keyword.
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.