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 Python -
ClassicalCiphers.ipynb
: Hill and Vigenère ciphers in Python -
LFSR.ipynb
: LFSR in Sage -
Coppersmith.ipynb
: Coppersmith's attack on a small exponent -
CommonModulus.ipynb
: Common modulus attack -
RSA-ECB.ipynb
: RSA in ECB mode -
Jacobi.ipynb
: Computing Jacobi symbols -
Factorization.ipynb
: Integer factorization -
BabyStepGiantStep.ipynb
: Shanks's baby-step/giant-step algorithm -
PohligHellman.ipynb
: The Pohlig-Hellman algorithm -
IndexCalculus.ipynb
: The Index calculus algorithm -
ReblockingProblem.ipynb
: The reblocking problem for RSA -
EllipticCurves.ipynb
: Elliptic curves -
GroupSignature.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.