CrypTools / VigenereCipher

Secure cipher but now breakable

Home Page:https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vigenere Cipher

Secure cipher but now breakable

How it works

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.

Encoding

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 is cryptography, and the key is secretkey:

msg = cryptography
key = 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

Decoding the output O, into the message M knowing the key K, is just as simple:

M[i] = (O[i] - K[i]) mod 26

Implementations

Language Encrypt Decrypt
Javascript encrypt.js decrypt.js
Python encrypt.py decrypt.py
C vigenere.c vigenere.c

Running the tests

Tests are automatically handled by Travis CI.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Secure cipher but now breakable

https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher

License:MIT License


Languages

Language:JavaScript 37.4%Language:C 32.0%Language:Python 27.8%Language:Makefile 2.8%