Skip to main content

Implemenation of same basic algorithms used in cryptography.

Project description

kryptools

Gerald Teschl Gerald.Teschl@univie.ac.at

This package was written for my course on cryptography. Consequently its intention is mainly educational, that is, to show how basic algorithms are implemented. In particular, you are welcome to read (and modify) the source. Any suggestions on how to make the code more readable or make it better are welcome. However, my main goal is to keep it simple and readability will be preferred over small speed improvements.

It does not require any external libraries.

The tools contained are:

  • number theory: sqrt modulo primes, Jacobi/Legendre symbol, Chinese Remainder Theorem, continued fractions, etc.

  • primes: Sieve of Erathostenes, primality tests, generation of random safe/strong primes

  • solvers for discrete logarithms (naive, Pollard rho, Shanks baby step/giant step, index calculus, quadratic sieve)

  • integer factorization (Fermat, Pollard p-1, Lenstra's ECM, Dixon, basic quadratic sieve)

  • elliptic curves (Weierstrass form), group operations, order, discrete logarithms

  • linear algebra: Hermite normal form, Gram-Schmidt

  • lattices: Hadamard ratio, Babai rounding/nearest plane algorithm, lattice reduction (Lenstra-Lenstra-Lovaz)

  • Matrix: a class for Matrices (inverse, det, reduced echelon form, etc.)

  • Poly: a class for polynomials (division, modulo)

  • Zmod: a class for the ring of integers modulo an integer

Documentation can be found in the jupyter notebook (mostly done, but might not contain everything: use the force, read the source).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kryptools-0.9.5.tar.gz (31.2 kB view hashes)

Uploaded Source

Built Distribution

kryptools-0.9.5-py3-none-any.whl (39.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page