quantum-safe: Bridging the Post-Quantum Production Gap with a Hybrid-by-Default Python Cryptography Library
Audits nine PQC libraries against externally anchored production-readiness criteria and presents quantum-safe, a hybrid-by-default Python library, with ACVP conformance and per-operation benchmarks.
Schemes: ML-KEM, ML-DSA, SLH-DSA, X25519, HKDF-SHA256, LMS, XMSS, CycloneDX CBOM, X-Wing, Bouncy Castle, liboqs
Findings (quotes checked against the source text)
-
No audited library provides automated cryptographic asset discovery and inventory; the gap is the sharpest one found.
zero of seven provide automated cryptographic asset inventory.
-
Stateful hash-based signing (LMS/XMSS) is present in only one of seven audited libraries, which is a key gap for CNSA 2.0 users.
Bouncy Castle is the only audited library
-
A hybrid KEM in the quantum-safe library takes three lines of application code, versus roughly 45 lines of manual combiner code.
The hybrid KEM task in quantum-safe is three lines
-
The Python combiner overhead (HKDF, serialisation, object handling) is substantial, accounting for most of the hybrid KEM handshake cost.
The combiner overhead is substantial: about 26.2 µs on keygen
-
Hybrid KEM throughput does not scale with threads because the Python layer holds the GIL; a server wanting several cores should use processes.
should use processes, not threads.
-
Throughput stays flat from 100 to 5,000 concurrent threads but below single-thread rate, so this shows graceful degradation, not parallelism.
Throughput is flat from 100 to 5,000 concurrent threads
Numbers (as extracted, not quote-checked)
- Full X25519 + ML-KEM-768 hybrid KEM handshake median (ENV-2, Docker/Linux): 231 µs
- X25519-only handshake median (same library): 43.5 µs
- ML-KEM-768 keygen median (ENV-2): 8.7 µs
- ML-DSA-65 sign median (ENV-2): 61.6 µs
- ML-KEM-768 public key size: 1,184 bytes
- Hybrid overhead as share of LAN/intra-datacenter TLS 1.3 budget: 0.46–2.3%
For builders
Use hybrid X25519+ML-KEM with a standard versioned key format and a tested combiner rather than hand-rolled concatenation, and plan LMS/XMSS and a CBOM from the start if CNSA 2.0 applies.
Limits
Benchmarks are one Docker/Linux and one Windows host with Python 3.12 and GIL; not CMVP validated; defaults are below CNSA 2.0 levels; the paper is a single-author preprint.
Topics: kem sig-lattice sig-stateful sig-hash-based hybrid-schemes benchmarks implementation-sidechannel standards-policy wallets-keys