Python for CryptoSys PQC
This is a Python interface to the CryptoSys PQC library <https://www.cryptosys.net/pqc>.
CryptoSys PQC provides the three Post-Quantum Cryptography (PQC) algorithms specified by NIST in August 2024 considered to be secure against an attack by a large-scale quantum computer. These are
Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) specified in FIPS.203,
Module-Lattice-Based Digital Signature Algorithm (ML-DSA) specified in FIPS.204, and
Stateless Hash-based Digital Signature Algorithm (SLH-DSA) specified in FIPS.205.
All keys, signatures and ciphertext values in this library are input and output as byte arrays.
Known random values can be input to validate against test vectors.
For the DSA algorithms, options are provided to use the deterministic or hedged modes, to add a context string, and to use the pre-hash modes HashML-DSA and HashSLH-DSA. For ML-DSA, there is the option to use the ExternalMu-ML-DSA algorithm, passing mu as the message.
For ML-DSA and ML-KEM, the private key can be passed in expanded or “seed” form (the form is automatically detected by the length).
Requires: Python 3. CryptoSys PQC v1.0 or above must be installed on your system. This is available from
To use in Python’s REPL
Using wild import for simplicity.
>>> from crsyspqc import * # @UnusedWildImport
>>> General.version() # "hello world!" for CryptoSys PQC
10000
>>> Dsa.privatekey_size(Dsa.Alg.ML_DSA_65)
4032
The stricter way using the crsyspqc prefix.
>>> import crsyspqc
>>> crsyspqc.General.version() # Underlying core CryptoSys PQC dll
10000
>>> crsyspqc.__version__ # crsyspqc.py module version
'1.0.0.0000'
>>> crsyspqc.Dsa.signature_size(crsyspqc.Dsa.Alg.SLH_DSA_SHAKE_256F)
49856
Note that crsyspqc.General.version() gives the version number of the underlying core (native) CryptoSys PQC DLL, and crsyspqc.__version__ gives the version of the Python crsyspqc module.
Examples
There is a series of tests in test_crsyspqc.py (source). You should find an example there of what you want to do.
Contact
For more information or to make suggestions, please contact us at https://www.cryptosys.net/contact/
Metadata
Release files for crsyspqc 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crsyspqc-1.0.0.tar.gz | 265.8 kB | Without provenance | Details for crsyspqc-1.0.0.tar.gz |
Release files / crsyspqc-1.0.0.tar.gz
| Download URL | crsyspqc-1.0.0.tar.gz |
|---|---|
| Size | 265.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
407481267edb5cf14a8c1e25c919f9af21267296ec09df9fbbb02bdfc563e655
|
|
BLAKE2b-256 checksum How to use checksums |
f510558f3b1ce18846eba46067fee5d4059bcabebf7fc97e88a221735486e637
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.0
|
Security for crsyspqc 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.