lantern is a Python cryptanalysis library designed to identify and automatically break classical ciphers using modular analysis tools.
Cryptanalysis library for breaking classical ciphers
This tool is primarily used by cryptography enthusiasts, researchers, and security analysts to analyze ciphertexts, identify classical cipher types, and automatically decrypt well-known classical ciphers. It assists in both educational and practical cryptanalysis scenarios where breaking or studying classical encryption methods is required.
lantern requires Python 3.7 and has no external dependencies, making it lightweight and easy to integrate. It is designed for classical cipher cryptanalysis and may not support modern encryption algorithms. Users should have basic Python knowledge to utilize and extend the library effectively.
Ensure Python 3.7 is installed
Run pip3 install -U lantern to install the library
pip3 install -U lantern
Installs or upgrades the lantern cryptanalysis library
from lantern.modules import shift from lantern import fitness ciphertext = "iodj{EuxwhIrufhLvEhvwIrufh}" decryptions = shift.crack(ciphertext, fitness.english.quadgrams) print(decryptions[0])
Example Python code to automatically crack a ciphertext encrypted with a shift cipher using English quadgram fitness scoring
virtualenv -p python3.7 venv source ./venv/bin/activate
Set up and activate a Python 3.7 virtual environment for development or testing
pip3 install -Ur dev_requirements.txt
Install development dependencies for testing and building the project
py.test
Run tests in the current Python environment
tox
Run tests across multiple Python versions in isolated environments
pip3 install -Ur docs/requirements.txt
Install documentation building dependencies
make html
Build HTML documentation from source files