Cryptanalysis library for breaking classical ciphers
Branch: master
Clone or download
CameronLonsdale Update ngram.py documentation
Fixed spelling mistake
Latest commit 235e163 May 7, 2018

README.md

lantern

Documentation Status Build Status Coverage Status

lantern is a cryptanalysis library to assist with the identification and breaking of classical ciphers. The library provides general purpose analysis tools, as well as premade modules to break well known ciphers.

from lantern.modules import shift
from lantern import fitness

ciphertext = "iodj{EuxwhIrufhLvEhvwIrufh}"

decryptions = shift.crack(ciphertext, fitness.english.quadgrams)
print(decryptions[0])

In short, lantern can be used to:

  • Identify ciphers from ciphertext
  • Automatically crack well known ciphers
  • Analyze ciphertext to assist in the breaking of custom crypto systems

Installation

pip3 install -U lantern

Documentation

Full documentation available at lantern-crypto.readthedocs.io

Requirements

Python 3.4 or newer required.

lantern has no external dependencies outside of the standard library.

Usage

As a library, lanterns functionality can be used in REPL or pre-written scripts. The library aims to be highly modular and generalised, providing the user with the ability to extend / modify / combine functions with others to solve particular problems.

Example programs

Development

Testing

Setup a virtual environment.

virtualenv -p python3.5 venv
source ./venv/bin/activate

Install development requirements.

pip install -Ur dev_requirements.txt

Use py.test to run tests using your current working environment.

Use tox -r to build a new environment for each python version and run all tests.

Documentation

Document is built using sphinx and napoleon-sphinx.

Install documentation requirements.

pip install -Ur docs/requirements.txt

Build the HTML, output in build/html.

make html