This repository contains materials for the Cryptography and Computer Security course at the Faculty of Computer Science and Informatics, University of Ljubljana.
- Online tutorials from 2020/21
Currently, the following Jupyter notebooks for Python/Sage are available:
VigenereCipher.ipynb
: Vigenère cipher in PythonClassicalCiphers.ipynb
: Hill and Vigenère ciphers in PythonLFSR.ipynb
: LFSR in SageCoppersmith.ipynb
: Coppersmith's attack on a small exponentCommonModulus.ipynb
: Common modulus attackRSA-ECB.ipynb
: RSA in ECB modeJacobi.ipynb
: Computing Jacobi symbolsFactorization.ipynb
: Integer factorizationBabyStepGiantStep.ipynb
: Shanks's baby-step/giant-step algorithmPohligHellman.ipynb
: The Pohlig-Hellman algorithmIndexCalculus.ipynb
: The Index calculus algorithmReblockingProblem.ipynb
: The reblocking problem for RSAEllipticCurves.ipynb
: Elliptic curvesGroupSignature.ipynb
: The ACJT2000 group signature scheme
To use the algorithms in Python, make sure that the root of the repository is visible to Python. Then you may import them with
import algorithms
or
from algorithms import *
Currently, the following functions are available:
gcd
(fromeuclidean.py
)inverse
(fromeuclidean.py
)eea
(fromeuclidean.py
)crt
(frommodular.py
)jacobi
(frommodular.py
)solovayStrassen
(fromprimality.py
)millerRabin
(fromprimality.py
)pollardP1
(fromfactorization.py
)pollardRho
(fromfactorization.py
)totalFactorization
(fromfactorization.py
)factorizeByBase
(fromfactorization.py
)babyStepGiantStep
(fromdiscreteLogarithm.py
)pohligHellman
(fromdiscreteLogarithm.py
)logarithmTable
(fromdiscreteLogarithm.py
)indexCalculus
(fromdiscreteLogarithm.py
)points
(fromellipticCurves.py
)pointSum
(fromellipticCurves.py
)pointMultiply
(fromellipticCurves.py
)
See sources for the documentation.
Note that logarithmTable
requires Sage and will therefore not work with plain Python. indexCalculus
calls logarithmTable
if a table of logarithms is not specified. If it is given, the function can be used with plain Python.