pqblocks-fips-check
FIPS 203/204 boundary validator and hybrid post-quantum key exchange (X25519 + ML-KEM-768) with ML-DSA-65 signatures and CBOM reporting.
Overview
pqblocks-fips-check is a post-quantum cryptographic SDK and boundary validator implementing:
- Hybrid Key Exchange: Combines classical X25519 with NIST FIPS 203 ML-KEM-768 (X-Wing style combiner with HKDF-SHA256 fallback).
- Digital Signatures: NIST FIPS 204 ML-DSA-65 with strict context binding.
- CBOM Reporting: Generates composite bills of materials in SPDX 2.2 format with NIST algorithm OIDs and NSA CNSA 2.0 grading annotations.
- Boundary Validation: Enforces strict cryptographic boundary compliance, throwing
PQCUnavailableErrorwhen post-quantum components are missing or degraded.
Regulatory & Standards Alignment
- NIST FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM-768).
- NIST FIPS 204: Module-Lattice-Based Digital Signature Standard (ML-DSA-65).
- NSA CNSA 2.0: Commercial National Security Algorithm Suite 2.0 mandates.
- SPDX 2.2: Software Package Data Exchange Specification with Cryptographic Asset Extensions.
Installation
pip install pqblocks-fips-check
System Dependencies
pqblocks-fips-check delegates low-level lattice operations to liboqs (C reference library) and elliptic curve operations to cryptography (OpenSSL-backed):
# Ubuntu/Debian
sudo apt-get install liboqs-dev
# macOS (Homebrew)
brew install liboqs
Quickstart
from pqblocks_fips_check import (
hybrid_encap,
hybrid_decap,
sign,
verify_sig,
generate_cbom,
PQCUnavailableError,
)
from pqblocks_fips_check.hybrid import hybrid_keygen
# 1. Hybrid key exchange (X25519 + ML-KEM-768)
alice_pk, alice_sk = hybrid_keygen()
bob_pk, bob_sk = hybrid_keygen()
# Alice encapsulates shared secret for Bob
ct, ss_alice = hybrid_encap(bob_pk, b"session-context")
# Bob decapsulates the ciphertext
_, ss_bob = hybrid_decap(bob_sk, ct)
assert ss_alice == ss_bob
# 2. ML-DSA-65 signature with context binding
sig = sign(b"Critical message payload", context=b"audit-auth")
assert verify_sig(b"Critical message payload", sig, context=b"audit-auth")
# 3. Export SPDX CBOM
cbom_json = generate_cbom()
assert "ML-KEM-768" in cbom_json and "ML-DSA-65" in cbom_json
Performance Summary
Measured on Linux x86_64 across 500 timed runs per operation:
| Operation | Algorithm | Median Latency | P99 Latency | Throughput |
|---|---|---|---|---|
| Key Generation | X25519 + ML-KEM-768 | 0.076 ms | 0.096 ms | ~12,980 ops/sec |
| Encapsulation | X25519 + ML-KEM-768 | 0.172 ms | 0.252 ms | ~5,670 ops/sec |
| Decapsulation | X25519 + ML-KEM-768 | 0.148 ms | 0.172 ms | ~6,680 ops/sec |
| Sign | ML-DSA-65 | 0.098 ms | 0.345 ms | ~8,760 ops/sec |
| Verify | ML-DSA-65 | 0.044 ms | 0.058 ms | ~22,550 ops/sec |
| CBOM Generation | SPDX 2.2 JSON Export | 0.033 ms | 0.049 ms | ~29,460 ops/sec |
For complete benchmark methodology and profiling charts, see BENCHMARKS.md.
Security & Verification
- Official ACVP & Wycheproof Test Vectors: Tested against official NIST ACVP server test vectors for ML-DSA-65 (
ML-DSA-sigVer-FIPS204), ML-KEM-768 (ML-KEM-encapDecap-FIPS203), and Google Wycheproof vectors (mldsa_65_verify). - Cryptographic Boundary Protection: Boundary errors are surfaced explicitly via
PQCUnavailableErrorwith zero silent downgrade to insecure classical fallbacks. - Constant-Time Primitives: Underlying lattice operations are delegated to
liboqsconstant-time implementations.
For in-depth analysis and security considerations, see SECURITY_NOTES.md and TESTING.md.
License
Metadata
Release files for pqblocks-fips-check 0.1.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 |
|---|---|---|---|---|
| pqblocks_fips_check-0.1.0.tar.gz | 28.1 kB | Without provenance | Details for pqblocks_fips_check-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pqblocks_fips_check-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pqblocks_fips_check-0.1.0-py3-none-any.whl |
Total release size: 46.7 kB
Release files / pqblocks_fips_check-0.1.0.tar.gz
| Download URL | pqblocks_fips_check-0.1.0.tar.gz |
|---|---|
| Size | 28.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab1d1a699819f3aa5e5e59467a9dca4c50f9cbc3d103c448d2278beaece43aa0
|
|
BLAKE2b-256 checksum How to use checksums |
784d8d11a50ec48cb6eb4431cc4eba82e79a6b45218e1d4adb02220b54ea84fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pqblocks_fips_check-0.1.0-py3-none-any.whl
| Download URL | pqblocks_fips_check-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4a400a5046d2ef487d33ddd728f372f7c3ea0255e43433b5158603e1adff865
|
|
BLAKE2b-256 checksum How to use checksums |
1b82172b94c3c796881f71580c4f5ceca4ff85c7dd06c32830583253aba08f00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pqblocks-fips-check 0.1.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.