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.

Warning These tools are intended for experimenting with cryptographic algorithms. They are not intended for use in real applications.

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, Pollard rho, 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

  • GF2: a class for Galois fields GF(2^n)

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.12.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kryptools-0.9.12-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file kryptools-0.9.12.tar.gz.

File metadata

  • Download URL: kryptools-0.9.12.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for kryptools-0.9.12.tar.gz
Algorithm Hash digest
SHA256 5d38ffeb13ebdb0b0c443b4a7e10ab94ee7f0a8d6aa6ad78517d50d6fd3efb15
MD5 d740dd8b7b75963cf7d380828bcb7d8f
BLAKE2b-256 2006a038e20a6218254d92a4110d9d77e31cd381fed853598a1cb327aa89f4f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for kryptools-0.9.12.tar.gz:

Publisher: python-publish.yml on teschlg/kryptools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kryptools-0.9.12-py3-none-any.whl.

File metadata

  • Download URL: kryptools-0.9.12-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for kryptools-0.9.12-py3-none-any.whl
Algorithm Hash digest
SHA256 40df23361d0cf7bde4810a9539c51f7c55728956347e2ffddae5f0fff7d5bffc
MD5 9b9c92d2d1f318c13dcb2cf30a105c60
BLAKE2b-256 ccffde46ee8154a3cc2cceffc3e22c56aa3d8baae195cd3036b6e80430d8a758

See more details on using hashes here.

Provenance

The following attestation bundles were made for kryptools-0.9.12-py3-none-any.whl:

Publisher: python-publish.yml on teschlg/kryptools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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