The Vigenere cipher was named after Blaise de Vigenère. This substitutiom cipher was invented by Giovan Battista Bellaso in 1553, however, the scheme was later ameliorated by Blaise de Vigenère in the 19th century, and therefore acquired its present name. The Vigenere cipher is similar to the Caesar cipher, but is harder to break (it resisted all attempts for around three centuries).
If our message has a length of 12 for example, and our key is CRYPTOOLS
, then we just repeat it until the new key length is superior to the message length:
CRYPTOOLSCRYPTOOLS
And we take the first x
characters of this string, where x
is our message length:
CRYPTOOLSCRY
CRYPTOGRAPHY
|
v
CRYPTOOLSCRY
------------
EIWEMCUCSRYW
return "EIWEMCUCSRYW"
- Repeating key
- Cryptanalysis can determine the key length
Language | Encrypt | Decrypt |
---|---|---|
C | c/vigenere.c | c/vigenere.c |
Python | py/encrypt.py | py/decrypt.py |
JavaScript | js/encrypt.js | js/decrypt.js |