Skip to content

lukashavrlant/bletchley-park

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cryptanalysis historical ciphers

Bletchley Park is a python implementation of an encrypting/decrypting/cracking library for historical ciphers like Caesar shift cipher, substitution cipher, Vigenère cipher and transposition cipher. Only czech language is supported right now.

Why Bletchley Park? It's the place where ciphers and codes of several Axis countries were decrypted, most importantly the ciphers generated by the German Enigma and Lorenz machines.

Installation

You will need Python 2.7. Installation using git:

$ git clone git@github.com:havrlant/bletchley-park.git
$ cd bletchley-park
$ sudo python setup.py install
$ bletchleypark -h

Or simply download the zip file instead of cloning from GitHub.

Usage

See bletchleypark -h. Supported ciphers are:

  • caesar for Caesar/Shift cipher. Key has to be only one letter.
  • vig for Vigenère cipher. Key can be arbitrary word, i.e. [a-b]+.
  • subs for Substitution cipher; only encrypt/decrypt methods, no cracking method yet. Key has to be permutation of alphabet, for example camntwqzipryofxkhdlusbevjg.
  • trans for Transposition cipher. Key can be arbitrary word, i.e. [a-b]+.

Examples

If you want to encrypt a text "Hello World" using Caesar (Shift) cipher and the "b" key:

$ bletchleypark -t "Hello World" -e caesar -k b
ifmmpxpsme

To decrypt back to "Hello World" use:

$ bletchleypark -t "ifmmpxpsme" -d caesar -k b
helloworld

If you want to crack a text "..." which was encrypted by Vigenère cipher:

$ bletchleypark -c vig -t "..."

Or you can always use -i file option instead of -t. The file must be in utf-8. Use --charset option otherwise:

$ bletchleypark -c vig -i path/to/file.txt --charset cp1250

About

Cryptanalysis historical ciphers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages