A Python implementation of Kyber Post-Quantum KEM
Project description
NOT MAINTAINED ANYMORE
I wrote this implementation three years ago to understand Kyber - when it was a hot candidate to be selected in the NIST process. Meanwhile, there are other, better maintained implementations out there.
If you are looking for a clean, straight-forward and well-tested implementation of Kyber (now standardized as ML-KEM) I recommend the Python implementation of Markku-Juhani O. Saarinen.
Crystals-Kyber in Python
About
- just a toy implementation to better understand the algorithm
- all three 512, 768 and 1024 sec levels.
- ported from the reference and the Go Implementation, so not the fanciest Python code
- not hardened against (timing/other) side channel attacks
- test coverage is poor, use at your own risk
How To Use
Just take a look at ccakem.py. Functions
kem_keygenXXX(),kem_encapsXXX(pubkey, seed=None)andkem_decapsXXX(private_key, ciphertext)
correspond directly to the spec. For kem_encaps you can optionally provide a custom seed which is useful for debugging.
Typical kem, e.g. 512 sec level, would be
priv, pub = kem_keygen512()
secret1, cipher = kem_encaps512(pub)
secret2 = kem_decaps512(priv, cipher)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyky-1.0.0.tar.gz.
File metadata
- Download URL: pyky-1.0.0.tar.gz
- Upload date:
- Size: 406.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2276ff42ba684c2f85e9b705152b6866ccd74f5f1efe7c360641b2b9bd4e460a
|
|
| MD5 |
3126143eec44b936a1479ea8cf927f6e
|
|
| BLAKE2b-256 |
e3ba666e398d77a122f27caa79b60fb91e1a1f274bd175b8a82cd2d21a965a68
|
File details
Details for the file pyky-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyky-1.0.0-py3-none-any.whl
- Upload date:
- Size: 422.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d974d14a80810830a04ebfe788380d72576725b9eee4b2f875ccd7fc66436a6c
|
|
| MD5 |
46ef787f36fa3f4167bba082c4c5ffeb
|
|
| BLAKE2b-256 |
5b55cde74dff54661e4658d8350c5aaac9886c55801e5a4e1f22273a38ffa893
|