quantum-safe: Bridging the Post-Quantum Production Gap with a Hybrid-by-Default Python Cryptography Library
Animesh Shaw · 2026
Read quantum-safe: Bridging the Post-Quantum Production Gap with a Hybrid-by-Default Python Cryptography Library by Animesh Shaw (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-17061.txt.
Introduction
Shaw presents quantum-safe, a hybrid-by-default Python library closing the production gap, plus a nine-library audit. Hybrid combiners exist in three of six, and none offers discovery or inventory tools; quantum-safe adds a CBOM. Only Bouncy Castle holds a FIPS 140-3 certificate, while quantum-safe passes all 225 ACVP known-answer cases, conformance evidence, not validation. Bouncy Castle supports LMS and XMSS where quantum-safe has LMS only, with defaults below CNSA parameter sets. A full X25519 plus ML-KEM-768 handshake takes 231 microseconds, 5.3 times an X25519-only handshake.
Catalog record
| CREATOR | Animesh Shaw |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 48238 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.17061
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
quantum-safe: Bridging the Post-Quantum Production Gap with a Hybrid-by-Default Python Cryptography Library Animesh Shaw Abstract The August 2024 finalisation of FIPS 203 (ML-KEM), FIPS 204 (ML-DSA), and FIPS 205 (SLH-DSA) closed the algorithmic gap in post-quantum cryptography (PQC). The production gap — hybrid combiners, versioned key formats, protocol helpers, and migration tooling — remains open. We present quantum-safe , a Python library that closes all three critical gaps we identify, and a systematic evaluation of the nine-library ecosystem that quantifies them. We score nine PQC libraries across eight production-readiness dimensions. Three dimensions have coverage below 35%: hybrid KEM support (11%), migration tooling (22%), and protocol integration (33%). quantum-safe scores Full on all eight. The full API reduces the hybrid KEM task from 45 lines of manual combiner code to three lines, directly lowering the risk of insecure combiner implementations. We report the first statistically rigorous per-operation overhead measurement for a Python hybrid PQC library (3,000 iterations, CPU-pinned, bootstrapped 95% confidence intervals). A full X25519 + ML-KEM-768 handshake completes in 𝟐𝟒𝟑 μ s \mathbf{243\,\mu\text{s}} under Docker/Linux — 0.5–2.5% of a typical TLS 1.3 round-trip budget. At 5,000 concurrent users, throughput holds at 2,848 ops/s with only 4.9% degradation versus the single-user baseline, confirming that liboqs releases the Python GIL during C-level operations. We introduce Coefficient of Variation (CoV) as a practical timing side-channel proxy across all FIPS 203/204 operations. ML-KEM-768 decapsulation achieves CoV = 3.9%, within the AES-256-GCM noise floor (2.1%). ML-DSA-65 signing shows CoV = 51.5%, expected from FIPS 204 rejection sampling, not a side-channel. This CoV methodology has not previously been applied to PQC library evaluation and provides a lightweight complement to formal constant-time verification tools. All results are reproducible via a single Docker command. I Introduction On 13 August 2024, the National Institute of Standards and Technology (NIST) published three post-quantum cryptography standards: FIPS 203 [ 17 ] , FIPS 204 [ 16 ] , and FIPS 205 [ 18 ] . These documents standardise ML-KEM (derived from CRYSTALS-Kyber [ 4 ] ), ML-DSA (derived from CRYSTALS-Dilithium [ 8 ] ), and SLH-DSA as the drop-in replacements for RSA and ECDH in key exchange and digital signatures. The algorithmic question is settled. The production question is not. Consider what a software engineer must do today to add hybrid post-quantum key exchange to a Python service. They must install liboqs-python , write an X25519 key generation step, write a separate ML-KEM key generation step, concatenate the two public keys, run HKDF to combine the two shared secrets, wrap the result in a key derivation function appropriate for their protocol, and handle serialisation for both halves. The result is roughly 45 lines of boilerplate before the first application-specific byte is encrypted. Then they repeat this exercise for signatures, certificates, and protocol configuration. This friction is not accidental. It reflects a genuine gap in the PQC ecosystem: algorithm implementations exist, but the production layer — hybrid combiners, versioned key formats, protocol helpers, migration tooling — does not. Insecure combiner implementations are a known risk [ 27 ] , and prior work on cryptographic API usability shows that complexity directly predicts misuse [ 10 , 14 ] . I-A The Harvest Now, Decrypt Later Threat The urgency is real. Adversaries with access to encrypted network traffic can store ciphertext today and decrypt it once a cryptographically relevant quantum computer becomes available [ 15 ] . This “harvest now, decrypt later” (HNDL) attack is passive, undetectable, and already underway. Data with long confidentiality requirements — government communications, financial records, healthcare data — is already at risk under purely classical encryption. The NSA’s Commercial National Security Algorithm Suite 2.0 (CNSA 2.0) [ 19 ] mandates algorithm replacement by 2030 for national security systems. Commercial organisations face comparable regulatory pressure. The gap between the 2024 standard finalisation and the 2030 deadline is not large given the complexity of cryptographic migration in production infrastructure. I-B The Production Gap Despite this urgency, deployment stalls at the library layer. To understand why, we evaluated nine actively maintained PQC libraries across eight dimensions measuring production readiness. The results are shown in Fig. 1 . Three dimensions have coverage below 35%: • Hybrid KEM support (11%): Only cloudflare/circl provides a built-in hybrid combiner. Every other library exposes raw algorithm primitives, placing the burden of combining X25519 with ML-KEM on the application developer. • Migration path (22%): No library except Bouncy Castle (partially) provides tooling for upgrading classical keypairs, re-encrypting stored ciphertext, or scanning codebases for classical cryptography imports. • Protocol integration (33%): Application developers need TLS configuration helpers, X.509 certificate generation, and envelope encryption. Only three libraries provide partial protocol support; none provides full coverage. I-C Companion Work A companion paper [ 24 ] presents the Quantum-Safe Auditor (QSA), a static analysis tool that detects classical cryptography usage in Python codebases and recommends migration paths. QSA identifies where PQC migration is needed; quantum-safe provides the implementation to migrate to. The two tools are designed to work together in a production migration workflow. I-D Contributions This paper makes six contributions: 1. Production gap matrix. A systematic, reproducible evaluation of nine PQC libraries across eight production-readiness dimensions using a ternary rubric. 2. Hybrid overhead quantification. The first statistically rigorous per-operation latency measurement for a Python hybrid PQC library, including bootstrap 95% confidence intervals, Welch’s t -test, and Cohen’s d effect sizes. Full handshake: 243 µs (Docker/Linux). 3. Concurrent throughput analysis. The first published throughput-vs-concurrency curve for a Python hybrid PQC library, from 100 to 5,000 simultaneous users. Throughput degrades only 4.9% across a 50 \times increase in concurrent load. 4. CoV as timing side-channel proxy. A systematic Coefficient of Variation analysis across all FIPS 203/204 operations, using AES-256-GCM as a constant-time noise floor reference. 5. Zero-config hybrid API. The quantum-safe library reduces the hybrid KEM task from 45 lines of manual combiner code to three lines. 6. Open-source artefact. All code, 415 tests, and the complete benchmark harness are released under the Apache 2.0 licence. I-E Paper Organisation Section II covers the cryptographic background. Section III presents the gap analysis. Section IV describes library design. Section V presents benchmark methodology. Section VI presents results. Section VII discusses limitations and deployment implications. Section VIII surveys related work. Section IX concludes. II Background II-A Post-Quantum Cryptography Standards ML-KEM [ 17 ] is a key encapsulation mechanism based on the module learning-with-errors (MLWE) problem. It replaces Diffie-Hellman and ECDH in key exchange. Three parameter sets are defined: ML-KEM-512 (NIST security level 1, AES-128 equivalent), ML-KEM-768 (level 3, AES-192 equivalent), and ML-KEM-1024 (level 5, AES-256 equivalent). quantum-safe defaults to ML-KEM-768, balancing security margin with performance. The MLWE problem is believed to be hard even for polynomial-time quantum algorithms, unlike the discrete logarithm and integer factorisation problems underpinning RSA and ECDH. ML-DSA [ 16 ] is a digital signature scheme also built on MLWE. Its signing algorithm uses randomised hedged signing with a rejection-sampling loop, which causes variable execution time. This is a deliberate security design: the variable time is independent of the signing key, preventing fault-injection attacks that exploit deterministic signing. We discuss the timing implications in Section VI-D . SLH-DSA [ 18 ] is a stateless hash-based signature scheme offering security from different