- Notifications
You must be signed in to change notification settings - Fork5
Secure cipher but now breakable
License
CrypTools/VigenereCipher
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Secure cipher but now breakable
At its core, the vigenere cipher is several Caesar ciphers, with a different shift value depending on the key. It can be computed simply by hand, through the use of a vigenere table. In code, it can be done using modulo arithmetic.
To encode, we first convert every letter to a number between 0 and 25, where A is 0, and Z is 25. If the key is shorter than the message, it is repeated until they are the same length, i.e. if the message iscryptography
, and the key issecretkey
:
msg = cryptographykey = secretkeysec
The ith character of the output O, can be computed from the message M, and key K using the follwing formula:
O[i] = (M[i] + K[i]) mod 26
Decoding the output O, into the message M knowing the key K, is just as simple:
M[i] = (O[i] - K[i]) mod 26
Language | Encrypt | Decrypt |
---|---|---|
Javascript | encrypt.js | decrypt.js |
Python | encrypt.py | decrypt.py |
C | vigenere.c | vigenere.c |
Tests are automatically handled byTravis CI.
Please readCONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We useSemVer for versioning. For the versions available, see thetags on this repository.
- Luka Lafaye -Initial work -@lukalafaye
- Arthur Guiot -Wrote JS Implementation -@arguoit
- Lucas Gruwez -Clean up work -@lucasgruwez
See also the list ofcontributors who participated in this project.
This project is licensed under the MIT License - see theLICENSE.md file for details