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 build 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/https://github.com/jpgoldberg/toy-crypto-math@master --user
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.