Skip to main content

QuantGuard

A Measurement-Driven Research Framework for Post-Quantum Cryptographic Transition

Assessment, monitoring and protection against quantum-computing threats, anchored in reproducible TLS 1.3 measurements, crypto-agile architecture and the Mosca margin.

Version PyPI Python Zenodo DOI OSF DOI Figshare DOI Tests License: CC BY 4.0 License: MIT ORCID Status

Website · Paper (PDF) · Zenodo · OSF · Figshare · PyPI · Figures


Contents


Overview

QuantGuard studies how systems can be assessed, monitored and protected against quantum-computing threats, with a specific focus on the post-quantum transition of key establishment in TLS 1.3.

Classical public-key cryptography (RSA, ECC, finite-field DH) is broken by Shor's algorithm on a sufficiently large fault-tolerant quantum computer. The harvest-now-decrypt-later (HNDL) threat makes the question urgent today: adversaries record encrypted traffic and decrypt it once a cryptographically relevant quantum computer (CRQC) exists. Hybrid key exchange, which combines a classical primitive (X25519) with a post-quantum KEM (ML-KEM-768), is the deployed response, standardized as the TLS group X25519MLKEM768 (RFC 10024).

QuantGuard does not propose a new cryptographic primitive. It treats a fixed set of existing primitives (X25519, ML-KEM-768, X25519MLKEM768) as objects whose measured costs and guarantees are audited.

The project studies four questions, in order:

  1. What hybrid actually guarantees: a minimum bound, not a sum (paper §3.3).
  2. What it costs: CPU, bytes and flights, measured rather than estimated.
  3. How to deploy it safely: crypto-agile architecture and negotiation behavior.
  4. When to migrate: the Mosca margin and data-class prioritization.

Central question

What does a hybrid combiner actually guarantee, what does it cost in a real TLS 1.3 handshake, and how should a system decide when to migrate?

Sub-question: can a crypto-agile architecture keep the cost of the next algorithm change low, even if the current hybrid choice is later revised?

# Component Focus Status
1 Hybrid-security bound What does Adv_Hyb ≤ min{Adv_cl, Adv_pq} + Adv_KDF actually promise? ✅ Corrected (paper Eq. 4)
2 Measured cost Marginal CPU, bytes and flights for X25519MLKEM768 in TLS 1.3 ✅ Measured (Study B, 30k handshakes)
3 Negotiation behavior When does the hybrid cost an extra round trip (HRR)? ✅ Measured (Study C, 6 scenarios)
4 Migration timing Mosca margin, capacity planning, data-class ranking ✅ Analytical (Study D)

Research questions

ID Question Paper § Status
RQ1 What does a hybrid combiner actually guarantee, and what does it leave open? §3.3 ✅ Answered
RQ2 What is the marginal CPU, byte and latency cost of X25519MLKEM768 in a real TLS 1.3 handshake? §5.4 ✅ Measured
RQ3 Which negotiation and wire-size effects decide whether that cost is paid in extra round trips? §5.5 ✅ Measured
RQ4 How should urgency and sequencing be decided, and what architecture keeps the next algorithm change cheap? §6, §7 ✅ Analytical

Scope

In scope

  • Post-quantum transition of key establishment in TLS 1.3.
  • Hybrid key exchange (X25519MLKEM768, RFC 10024).
  • Reproducible measurement of CPU, byte and flight costs.
  • Negotiation behavior across six client/server scenarios.
  • Crypto-agile architecture and migration sequencing.
  • Mosca margin and data-class prioritization.

Out of scope

  • New cryptographic primitives.
  • Quantum-safe signature measurement (ML-DSA sizes only, from FIPS 204).
  • Network-level latency (model outputs only).
  • Production deployment or operational readiness.
  • CRQC date forecasting (Z is a swept parameter).
  • QKD deployment claims (formula only, not measured).

Explicit non-goals

  • Proving that hybrid key exchange is an end state (NIST: "typically temporary").
  • Proving that any specific primitive is superior.
  • Producing a reference implementation before Protocol v0.2 is frozen.
  • Reproducing the 15–28% latency-penalty claim from the supplied draft. It was refuted (paper Appendix C).

Five research axes

Axis Focus Status
A1 — Assessment Cryptographic inventory, vulnerability, hybrid-security bound ✅ Paper §3, §4
A2 — Monitoring & measurement Reproducible TLS 1.3 benchmarks, negotiation behavior ✅ Paper §5
A3 — Protection & architecture Crypto-agile architecture, transition planning ✅ Paper §6
A4 — Coupling & case studies Mosca margin, capacity planning, data-class ranking ✅ Paper §7
A5 — Experimental evaluation Methodology (L1/L2/L3), discrepancy register, threats to validity ✅ Paper §10, App. C

What is measured vs. what is claimed

Measured in this project

  • 30,000 full TLS 1.3 handshakes per group (X25519, ML-KEM-768, X25519MLKEM768) with OpenSSL 3.0.13 + oqs-provider.
  • Primitive costs for ML-KEM-512/768/1024 (liboqs speed_kem).
  • Negotiation behavior across six scenarios (3,000 handshakes each), including the HelloRetryRequest penalty.
  • Flight sizes for the hybrid handshake with an ECDSA P-256 leaf.
  • Bootstrap confidence intervals (4,000 resamples, seed 20261203).

Analytical (computed, not measured)

  • Wire-size and TCP-flight model for ML-DSA certificate chains (FIPS 204 sizes).
  • Mosca margins for five synthetic data classes.
  • Capacity-planning calculation from measured CPU deltas.
  • QKD secret-key-rate formula.

Not claimed

  • Network-level latency (model outputs only, no real network).
  • ML-DSA authentication by measurement (sizes only).
  • Hybrid as an end state (NIST: "typically temporary").
  • A CRQC date forecast (Z is a swept parameter).
  • Production deployment or operational readiness.

Evidentiary labels

Every table, figure and headline number in the paper carries one of four labels.

Label Meaning
[M] Measured: produced by running code for this paper.
[A] Analytical: computed from published sizes or [M] values with a stated model.
[I] Illustrative: built on stated assumptions, not real data.
[C] Cited: taken from a source in the reference list.

The convention is enforced throughout the manuscript and appendices. All nine figures in Figures are [I].

Key findings (v0.1.0)

  1. Corrected hybrid bound (paper Eq. 4): Adv_Hyb ≤ min{Adv_cl, Adv_pq} + Adv_KDF. The sum bound in the supplied draft is vacuous when one component fails, which is exactly the case the argument is about.
  2. Hybrid cost measured: +72 µs median total CPU per handshake vs. X25519 (+12%), 95% bootstrap interval 71–74 µs.
  3. Wire overhead: +1,176 B (client) and +1,087 B (server) per flight.
  4. No extra round trip with an ECDSA leaf under an initial window of ten segments.
  5. HelloRetryRequest penalty: one extra round trip (5 flights instead of 3) when the client offers hybrid and the server supports only X25519.
  6. ML-DSA-65 two-cert chain: computed 15.7 kB server flight, above the 14.5 kB initial window.
  7. 15–28% latency-penalty claim not reproduced (it was in the supplied draft).
  8. Mosca margin ranking robust for classes 4–5 (exposed for all Z in the sweep) and 1–2 (never exposed); class 3 is Z-sensitive.

Methodological choices

The TLS group, primitive sizes and measurement protocol are fixed in advance and recorded in docs/decisions/.

TLS group

Group Outcome Reason
X25519 ✅ Baseline Classical, deployed, RFC 8446
ML-KEM-768 ✅ PQ-only baseline FIPS 203, standardized
X25519MLKEM768 ✅ Selected (hybrid) RFC 10024, deployed in Chrome and Firefox

Measurement environment

Parameter Value
OS Linux (Termux, Android)
OpenSSL 3.0.13
oqs-provider 0.7.0
liboqs 0.10.0
Python 3.11
Seed Fixed (20261203)
Handshakes per group 30,000

Statistical protocol

Step Method
Central tendency Median (not mean; heavy tail)
Confidence interval Bootstrap, 4,000 resamples, seed 20261203
Effect size Common-Language Effect Size (CLES)
Distribution comparison Mann–Whitney U

Experimental programme

Component Count Detail
Studies 4 A (primitives), B (handshake CPU), C (negotiation), D (analytical)
TLS groups 3 X25519, ML-KEM-768, X25519MLKEM768
Scenarios 6 C1–C6, including HRR-triggering combinations
Handshakes (Study B) 90,000 30,000 × 3 groups
Handshakes (Study C) 18,000 3,000 × 6 scenarios
Validation tests 53 All passing
Stage Status
Study A (primitives) ✅ Completed
Study B (handshake CPU) ✅ Completed
Study C (negotiation) ✅ Completed
Study D (analytical) ✅ Completed
Reproducibility diff ✅ 0.00 (all 9 medians)

Reproducibility snapshot

Check Result
Median CPU diff (3 groups × 3 metrics) 0.00
Bootstrap CI (total CPU) [71.08, 73.83] µs (paper: [71, 74])
CLES 0.711 (paper: 0.71)
Test suite 53 / 53 passed

Figures

Figure 1: Module-LWE lattice illustration
Figure 1 [I]. Module-LWE intuition on a lattice: b = A·s + e (mod q) is the point A·s mod q displaced by a small noise vector e. Distinguishing b from uniform is believed to be intractable.

Figure 2: Two-dimensional projection of an n-dimensional integer lattice
Figure 2 [I]. Alternative rendering of the lattice illustration: a 2D projection of an n-dimensional integer lattice with the same b = A·s + e (mod q) construction.

Figure 3: Hybrid security Venn diagram
Figure 3 [I]. Hybrid security: secure if at least one primitive holds. Classical X25519 is broken by Shor's algorithm (future CRQC); ML-KEM-768 only by a hypothetical algebraic breakthrough. Note: the formula printed in the figure is the superseded sum bound; the paper's corrected bound is a minimum (Eq. 4).

Figure 4: Public key and ciphertext size comparison
Figure 4 [I]. Public key and ciphertext sizes at NIST Security Level 3: X25519 (32 / 32 B), ML-KEM-768 (1,184 / 1,088 B), X25519MLKEM768 (1,216 / 1,120 B).

Figure 5: CPU processing overhead across handshake iterations
Figure 5 [I]. Illustrative plan for CPU time per handshake across iterations for X25519, ML-KEM-768 and hybrid. The plotted values and platform label are not the executed measurements (Study B: 30,000 handshakes per group, Linux/Termux).

Figure 6: Handshake latency versus RTT
Figure 6 [I]. Illustrative handshake latency across LAN, WAN and mobile/satellite settings for classical, pure PQC and hybrid. Network-level latency is not measured or claimed by this project (model outputs only).

Figure 7: Throughput versus effective payload size
Figure 7 [I]. Illustrative post-handshake throughput versus effective payload size for classical and hybrid, with the fragmentation zone and the ≈2.3 KB handshake expansion marked.

Figure 8: Crypto-agile abstraction layer architecture
Figure 8 [I]. Crypto-agile abstraction layer: applications, transport and application interfaces (TLS, IPsec, SSH, QUIC), an agility layer (policy and negotiation engine, provider abstraction interface, telemetry and CBOM inventory), and cryptographic providers (OpenSSL providers, PKCS#11, liboqs).

Figure 9: Phased enterprise transition roadmap to post-quantum cryptography
Figure 9 [I]. Phased enterprise transition roadmap: discovery and inventory, hybrid TLS/VPN deployment, PKI and authentication upgrade, and deprecation of classical primitives, against NIST IR 8547 milestones (2024, 2030, 2035).


Installation

Requires Python 3.10+, NumPy 1.26+ and SciPy 1.12+.

pip install pqguard

From source (development):

git clone https://github.com/gitdeeper16/QuantGuard.git
cd QuantGuard
pip install -e ".[dev]"

Quickstart

import numpy as np
from quantguard import (
    mosca_margin,
    capacity_planning,
    wire_size_analysis,
)

# 1. Mosca margin for a synthetic data class
#    X = migration time (years), Y = shelf-life (years), Z = CRQC horizon (years)
X, Y, Z = 3.0, 5.0, 8.0
margin = mosca_margin(X=X, Y=Y, Z=Z)
print(f"Mosca margin = {margin:.2f} years  (exposed = {margin < 0})")

# 2. Capacity planning from a measured CPU delta
#    delta_cpu_us = 72 (measured), target_qps = 10_000
plan = capacity_planning(delta_cpu_us=72, target_qps=10_000)
print(f"Additional cores required: {plan['extra_cores']:.2f}")

# 3. Wire-size model for a hybrid handshake
sizes = wire_size_analysis(
    group="X25519MLKEM768",
    signature="ECDSA-P256",
)
print(f"Client flight: {sizes['client_bytes']} B")
print(f"Server flight: {sizes['server_bytes']} B")

Command-line interface

pqguard --version
# pqguard 0.1.0

pqguard --info
# QuantGuard v0.1.0 — measurement-driven research on PQC transition.
# Zenodo:   10.5281/zenodo.24766430
# OSF:      10.17605/OSF.IO/W4S7Y
# Figshare: 10.6084/m9.figshare.35203780
# Repo:     https://github.com/gitdeeper16/QuantGuard

Subcommands:

pqguard-analyze    # Analyze Study B handshake CPU data
pqguard-model      # Model Study D wire sizes and flights
pqguard-mosca      # Compute Mosca margins
pqguard-capacity   # Capacity-planning calculation
pqguard-wire       # Wire-size analysis for a given TLS group

Features

Feature Status
Corrected hybrid-security bound (min{Adv_cl, Adv_pq} + Adv_KDF) ✅
Measured TLS 1.3 handshake CPU (30k × 3 groups) ✅
Negotiation behavior (6 scenarios, HRR detection) ✅
Wire-size model (ML-DSA sizes from FIPS 204) ✅
Mosca margin calculator ✅
Capacity-planning calculator ✅
Bootstrap confidence intervals (4,000 resamples) ✅
CLES effect size ✅
CLI (pqguard --version, --info, subcommands) ✅
Reproducibility diff = 0.00 ✅

Repository structure

QuantGuard/
├── README.md
├── PROJECT_STATUS.md
├── CHANGELOG.md
├── CITATION.cff
├── LICENSE                     # CC-BY-4.0 docs, MIT code
├── AUTHORS.md
├── INVENTORY.md
│
├── docs/
│   ├── manuscript/             # Paper v0.1.0 (PDF + 6 appendices)
│   ├── protocol/               # Protocol v0.1 template
│   └── decisions/              # Q1–Q5 decision log
│
├── figures/
│   └── conceptual/             # Figure_01 … Figure_09 (PNG, illustrative)
│
├── measurements/               # Reproducible benchmarks (2.2 MB)
│   ├── Study_A_Primitives/     # liboqs speed_kem
│   ├── Study_B_Handshake_CPU/  # 30,000 handshakes × 3 groups
│   ├── Study_C_Negotiation/    # 3,000 handshakes × 6 scenarios
│   └── Study_D_Analytical/     # Wire-size + TCP-flight model
│
├── harness/                    # Measurement tools
│   ├── tls13_handshake_bench.c
│   ├── tls13_handshake_bench_v2.c
│   ├── Makefile
│   ├── scripts/
│   └── configs/
│
├── src/quantguard/             # Python package (import name)
│   ├── __init__.py
│   ├── analyze_study_b.py
│   ├── model_study_d.py
│   ├── mosca_margin.py
│   ├── capacity_planning.py
│   ├── wire_size_analysis.py
│   └── py.typed
│
├── analysis/                   # Analysis scripts (legacy layout) + plots/
├── tests/                      # 53 validation tests
├── design/                     # Architecture and threat model
├── data/                       # External data
├── results/                    # Processed results
├── logs/                       # Execution traces
└── netlify/                    # ⚠️ Site content (audit pending)

This is a protocol plus executed measurements repository. It is not a general-purpose PQC library.

Testing and verification

Element Status
Problem formulation ✅ Complete
Hybrid-security bound ✅ Corrected (paper Eq. 4)
Measurement protocol ✅ Frozen (seeds, versions, commits)
Study A (primitives) ✅ Executed
Study B (handshake CPU) ✅ Executed (90,000 handshakes)
Study C (negotiation) ✅ Executed (18,000 handshakes)
Study D (analytical) ✅ Executed
Automated tests ✅ 53 / 53 passed
Reproducibility diff ✅ 0.00 (all 9 medians)
Final decision 🟡 Under review
pytest tests/ -q
# 53 passed

What this repository does not claim

  • ✖ That hybrid key exchange is an end state.
  • ✖ That any specific PQC primitive is superior.
  • ✖ Network-level latency (model outputs only).
  • ✖ ML-DSA authentication measured (sizes only, from FIPS 204).
  • ✖ CRQC date forecasts (Z is a swept parameter).
  • ✖ Production deployment or operational readiness.
  • ✖ A general-purpose PQC library.

Threats to validity

# Threat Description
T1 Measurement environment Single-host measurements (Linux/Termux); cross-platform replication pending.
T2 Version pinning OpenSSL 3.0.13 + oqs-provider 0.7.0; newer versions may differ.
T3 Illustrative figures All nine figures in figures/conceptual/ are plans of analysis or conceptual diagrams ([I]); real data is in measurements/.
T4 Analytical wire-size model ML-DSA sizes from FIPS 204; no measured ML-DSA handshakes yet.
T5 Bootstrap seed 4,000 resamples with seed 20261203; different seeds may shift CIs marginally.
T6 Author-on-author reasoning The hypothesis and the protocol were written by the same author.
Area References Role
Post-quantum cryptography Shor (1994); NIST FIPS 203/204/205 Primitive background
TLS 1.3 RFC 8446; RFC 10024 Protocol and hybrid group
Hybrid key exchange Bindel et al.; Stebila et al.; Celi et al. Combiners and proofs
Harvest-now-decrypt-later Mosca (2018); NIST IR 8547 Threat framing
Crypto-agility Housley; NIST SP 800-227 (draft) Architecture
Measurement methodology Georges et al.; Laaber et al.; Raasveldt et al. Benchmark design
Mosca margin Mosca (2018); Mosca & Piani (2024) Migration timing
QKD Scarani et al.; Diamanti et al. Out-of-scope formula only

Citation

Machine-readable metadata is in CITATION.cff.

APA

Baladi, S. (2026). QuantGuard: A Measurement-Driven Research Framework for Post-Quantum Cryptographic Transition (Version 0.1.0). Zenodo. https://doi.org/10.5281/zenodo.24766430

BibTeX (protocol)
@misc{baladi2026quantguard,
  author    = {Baladi, Samir},
  title     = {QuantGuard: A Measurement-Driven Research Framework for Post-Quantum Cryptographic Transition},
  year      = {2026},
  version   = {0.1.0},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.24766430},
  url       = {https://doi.org/10.5281/zenodo.24766430},
  note      = {OSF Preregistration: 10.17605/OSF.IO/W4S7Y. Figshare: 10.6084/m9.figshare.35203780}
}
BibTeX (Python package)
@misc{baladi2026quantguard_pypi,
  author       = {Baladi, Samir},
  title        = {{pqguard}: Python Package for the QuantGuard Protocol},
  year         = {2026},
  month        = {December},
  howpublished = {Python Package Index (PyPI)},
  url          = {https://pypi.org/project/pqguard/},
  note         = {Install: pip install pqguard. Import name: quantguard. MIT License.}
}

Related identifiers

Resource Identifier Type
OSF preregistration 10.17605/OSF.IO/W4S7Y DOI
Zenodo (paper + code) 10.5281/zenodo.24766430 DOI
Figshare (alternative DOI) 10.6084/m9.figshare.35203780 DOI
PyPI pqguard Package
ORCID 0009-0003-8903-0029 ORCID

Author

Samir Baladi, Interdisciplinary AI Researcher, Ronin Institute / Rite of Renaissance

Email gitdeeper@gmail.com
ORCID 0009-0003-8903-0029
Website github.com/gitdeeper16/QuantGuard
Mirrors GitHub · GitLab · Codeberg · Bitbucket

License

Documentation and paper: CC BY 4.0. Code: MIT (see LICENSE).


QuantGuard v0.1.0 — measurement-driven research on post-quantum cryptographic transition.

© 2026 Samir Baladi · Ronin Institute / Rite of Renaissance

Paper DOI: 10.5281/zenodo.24766430 · ORCID: 0009-0003-8903-0029

Metadata

Release files for pqguard 0.1.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 pqguard 0.1.0
File Size Uploaded Provenance Actions
pqguard-0.1.0.tar.gz 2.2 MB Without provenance Details for pqguard-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pqguard 0.1.0
File Interpreter ABI Platform Actions
pqguard-0.1.0-py3-none-any.whl Python 3 none any Details for pqguard-0.1.0-py3-none-any.whl

Total release size: 2.3 MB

Release files / pqguard-0.1.0.tar.gz

Download URL pqguard-0.1.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
7f2f945442b9b313f3b08c0343916417f36b5686bb5e23b3de4935f0f6a96d0f
BLAKE2b-256 checksum
How to use checksums
b38b88b534913e9bc68db2cf4360b1ceb7bf9330888299d51d2bcce1d1738378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.33.1

Release files / pqguard-0.1.0-py3-none-any.whl

Download URL pqguard-0.1.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c910d5969a3a14abe7e7de0ab947a2f109587641adeaf3881c12be49904930b1
BLAKE2b-256 checksum
How to use checksums
7e7c2e2a393b825fcfe2a7103c89072459723b465dd128344356d699504f37fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.33.1

Security for pqguard 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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