A cryptography library.
Project description
Quantumcrypto
Collection of tools designed to handle cryptography in post quantum computers world.
Warning: The security cannot be guaranteed. For now, do not use in real projects!
ML-KEM
ML-KEM implementation.
TODO: Add documentation.
Description
The implementation of ML-KEM Standard, one of the three Federal Information Processing Standards (FIPS) approved for post-quantum cryptography. This standard is specified in NIST FIPS 203. For this project, the FIPS 203 standard has been implemented for use in a cryptographic library
Background
A key-encapsulation mechanism (KEM) is a set of algorithms that, under specific conditions, enable two parties to establish a shared secret key over a public channel.
The securely established shared key can then be utilized with symmetric-key cryptographic algorithms to perform fundamental tasks in secure communications, such as encryption and authentication.
Although quantum computers are not yet fully realized, they are believed to have the potential to break existing cryptographic standards. In anticipation of this, NIST has approved three new standards for post-quantum cryptography to ensure the world is prepared when quantum computers become a reality.
Currently, ML-KEM is considered secure, even against adversaries equipped with large-scale, fault-tolerant quantum computers. This standard defines the algorithms and parameter sets for the ML-KEM scheme:
• The three parameter sets, listed in order of increasing security strength and decreasing performance, are: ML-KEM-512, ML-KEM-768, and ML-KEM-1024. • The key exchange algorithms specified are: ML-KEM.KeyGen, ML-KEM.Encaps, and ML-KEM.Decaps.
How the standard has been implemented
All the sub-algorithms have been implemented as functions in Python to realize the three main algorithms: ML-KEM.KeyGen, ML-KEM.Encaps, and ML-KEM.Decaps. The parameter sets: ML-KEM-512, ML-KEM-768, and ML-KEM-1024 have also been well-defined, allowing users to easily select their desired parameter set based on desired security and performance level.
Algorithms
ML-KEM operates with three algorithms: • ML-KEM.KeyGen Using internally generated randomness and requiring no input, the ML-KEM.KeyGen algorithm produces an encapsulation key and a decapsulation key. The encapsulation key can be made public, while the decapsulation key shall remain private.
• ML-KEM.Encaps The ML-KEM.Encaps algorithm accepts an encapsulation key as input, generates randomness internally, and outputs a ciphertext and a shared key.
• ML-KEM.Decaps The ML-KEM.Decaps algorithm accepts a decapsulation key and an ML-KEM ciphertext as input, uses no randomness, and outputs a shared secret key.
Parameter Sets
To instantiate ML-KEM, one must select a parameter set. Each parameter set is associated with a particular trade-off between security and performance. The three possible parameter sets are explained below: • ML-KEM-512 (security category 1) • ML-KEM-768 (security category 3) • ML-KEM-1024 (security category 5)
How to use the product
-
Install with
pip install quantumcrypto. View Project Site here -
import the parameter sets
from quantumcrypto.utils.parameters import P512, P768, P1024
- import the functions
from quantumcrypto.utils.functions import ml_kem_gey_gen, ml_kem_encaps, ml_kem_decaps
-
Select a parameter set. If none is selected, the strongest parameter set (P1024) is used by default.
-
Proceed to generate keys using the specified algorithms.
- use as described in ml_kem.py
How to contribute to the project
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 Distributions
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 quantumcrypto-0.2.1-py3-none-any.whl.
File metadata
- Download URL: quantumcrypto-0.2.1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5538f216a210ae8c0f07f389e75e9d75b6dbb5685bcd022e3d599d3d82f5a943
|
|
| MD5 |
194ffd486add76bba6047b3815423afd
|
|
| BLAKE2b-256 |
ce9484280cf44caa747eab1edea0aa7b8f8b55f20f2739b9c22dbf19fd8f8890
|