Skip to main content

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

https://www.cryptosys.net/pqc

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/

David Ireland
DI Management Services Pty Ltd t/a CryptoSys
Australia
21 May 2025

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)

Source distribution for crsyspqc 1.0.0
File Size Uploaded
crsyspqc-1.0.0.tar.gz 265.8 kB Details

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page