This repository implements a toolkit for cryptanalysis using lattice reduction built for experimenting and learning. Check out the accompanying tutorial for some background.
The toolkit can be used with both Python and Sage. To get started, clone the repository:
git clone https://github.com/josephsurin/lattice-based-cryptanalysis.git
Then run
cd lattice-based-cryptanalysis
pip install .
and/or (to make it available within Sage)
cd lattice-based-cryptanalysis
sage -pip install .
The lbc_toolkit
module is then available to import functions from:
from lbc_toolkit import hnp
The toolkit can also be used without installing via pip. Add the repository's location to the PYTHONPATH
environment variable:
export PYTHONPATH="/path/to/lattice-based-cryptanalysis:$PYTHONPATH"
The lbc_toolkit
module is then available to import functions from:
from lbc_toolkit import hnp
As an alternative to setting PYTHONPATH
, modifying sys.path
works too:
import sys
sys.path.append('path/to/lattice-based-cryptanalysis')
from lbc_toolkit import hnp
The examples/
directory contains usage examples of almost all of the available functions.
Some documentation for the available functions can be found at docs/
.