Skip to content

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

Notifications You must be signed in to change notification settings

jrinconada/cracking-caesar-cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

Usage examples

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages