Danger
Nothing here should be used for any security purposes.
Toy cryptographic functions and utilities¶
Some toy (unsafe for actual use) cryptography related utilites.
Installation¶
Remember that nothing here is built to be used for security purposes, but if you must:
python3 -m pip install toycrypto --user
python3 -m pip install git+https://github.com/jpgoldberg/toy-crypto-math@master --user
Note that that due to an issue,
sphinx-toolbox/sphinx-toolbox#184,
in the generation of this document,
github instructions incorrectly list the branch as master
.
It really is main
.
Import names¶
Once installed, the modules are imported under toy_crypto
.
For example, Number Theory module would be imported with import toy_crypto.nt
.
>>> from toy_crypto.nt import factor
>>> n = 69159288649
>>> factorization = factor(n)
>>> factorization.data
[(11, 2), (5483, 1), (104243, 1)]
>>> str(factorization)
'11^2 * 5483 * 104243'
>>> factorization.n == n
True
>>> factorization.phi
62860010840
Note again that the SageMath Factorization class is far more efficient and general than what exists in this toy cryptography module.
Table of Contents¶
- Motiviation
- Utility functions
- Number Theory
- Sieve of Eratosthenes
- RSA
- Elliptic curves
- Random Numbers
- Security games
- Birthday Paradox Computations
- Types
- Vigenère cipher
- bibliography