项目作者: jrinconada

项目描述 :
Visualising letter frequency in encrypted messages using Caesar and Vigenère ciphers
高级语言: Python
项目地址: git://github.com/jrinconada/cracking-caesar-cipher.git
创建时间: 2019-07-02T17:26:07Z
项目社区:https://github.com/jrinconada/cracking-caesar-cipher

开源协议:

下载


Cracking Caesar Cipher

Visualising letter frequency in encrypted massages using Caesar and Vigenère ciphers.

Some examples of the graphs

Sample graphs

About the encryption used

For simplicity, characters that are not part of the English alphabet are ignored by the cipher and included in the final result.
Some examples of ignored characters are: spaces, numbers, punctuation, symbols, other alphabet letters…

In a real life example this characters may also be encrypted to preserve the integrity of the original message and not to reveal any structural clues that might ease the cracking of the encoded message.

Usage

It is written in Python 3 using matplotlib for the graphs and numpy for some number and list processing, so all of this must be installed.

To run the program the following parameters must be specified:

  • Option: encrypt or decrypt or e or d to choose encryption or decryption of the message.
  • Caesar cipher key: Must be an integer number.
  • Vigenère cipher key: Must be word composed of letters from a to z.
  • Message: Can be typed directly in the console or read from a file with option -i.
  • Result [optional]: By default the result is shown in the console, it can be saved to a file with option -o.

General form

  1. python main.py encrypt/decrypt caesar-key vigenere-key [message] [-i in.txt] [-o out.txt]

Usage examples

  1. main.py encrypt 13 thekey hello
  2. main.py e 13 thekey hello
  3. main.py e 5 anotherkey this is a longer message
  4. main.py decrypt -1 thisisverystrongkey hal
  5. main.py encrypt 13 thekey -i letter.txt -o secret.txt