Quantum-Safe Code Auditing: LLM-Assisted Static Analysis and Quantum-Aware Risk Scoring for Post-Quantum Cryptography Migration
Pith reviewed 2026-05-21 10:53 UTC · model grok-4.3
The pith
A hybrid static analysis framework detects 15 classes of quantum-vulnerable cryptographic primitives in code and prioritizes fixes using regex, LLM context, and VQE risk scoring.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The Quantum-Safe Code Auditor identifies quantum-vulnerable primitives through regex rules for 15 classes, applies LLM-assisted enrichment to determine usage context and severity, then assigns migration priority via a Variational Quantum Eigensolver model that incorporates qubit-cost estimates; on a stratified sample of 602 labelled instances drawn from 5,775 findings across five open-source libraries the system records 71.98 percent precision, 100 percent recall, and an F1 score of 83.71 percent.
What carries the argument
The Quantum-Safe Code Auditor pipeline that links regex-based primitive detection, LLM contextual classification, and VQE-driven risk scoring with qubit-cost estimates.
If this is right
- Codebases can be scanned automatically to produce an inventory of every quantum-vulnerable primitive without exhaustive manual search.
- Migration planning can be ordered by a computed quantum-risk score rather than uniform treatment of all findings.
- The same detection rules apply across Python, JavaScript, and Java libraries, indicating language portability.
- Open release of code, data, and scripts allows direct reproduction and extension on new projects.
Where Pith is reading between the lines
- Embedding the auditor in continuous-integration pipelines would turn quantum-risk checks into a routine gate rather than a one-time audit.
- If the qubit-cost component proves stable, the same scoring method could be adapted to other resource-based risk problems outside cryptography.
- High recall combined with moderate precision implies the tool is best used as a broad net followed by human triage of the flagged items.
Load-bearing premise
The VQE model using qubit-cost estimates produces reliable prioritization of migration risks even though no validation details or comparison baselines are supplied for that component.
What would settle it
Running the VQE risk scorer on a fresh set of labelled findings and finding that its priority order shows no better-than-random agreement with expert-assigned migration urgency would falsify the prioritization claim.
Figures
read the original abstract
The impending arrival of cryptographically relevant quantum computers (CRQCs) threatens the security foundations of modern software: Shor's algorithm breaks RSA, ECDSA, ECDH, and Diffie-Hellman, while Grover's algorithm reduces the effective security of symmetric and hash-based schemes. Despite NIST standardising post-quantum cryptography (PQC) in 2024 (FIPS 203 ML-KEM, FIPS 204 ML-DSA, FIPS 205 SLH-DSA), most codebases lack automated tooling to inventory classical cryptographic usage and prioritise migration based on quantum risk. We present Quantum-Safe Code Auditor, a quantum-aware static analysis framework that combines (i) regex-based detection of 15 classes of quantum-vulnerable primitives, (ii) LLM-assisted contextual enrichment to classify usage and severity, and (iii) risk scoring via a Variational Quantum Eigensolver (VQE) model implemented in Qiskit 2.x, incorporating qubit-cost estimates to prioritise findings. We evaluate the system across five open-source libraries -- python-rsa, python-ecdsa, python-jose, node-jsonwebtoken, and Bouncy Castle Java -- covering 5,775 findings. On a stratified sample of 602 labelled instances, we achieve 71.98% precision, 100% recall, and an F1 score of 83.71%. All code, data, and reproduction scripts are released as open-source.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper claims to introduce 'Quantum-Safe Code Auditor', a framework combining regex-based detection of quantum-vulnerable primitives, LLM-assisted contextual enrichment, and VQE-based risk scoring for prioritizing post-quantum cryptography migration in codebases. Evaluation on five libraries with 5775 findings shows 71.98% precision, 100% recall, and 83.71% F1 on 602 samples, with open-source release.
Significance. If validated, this could provide a practical tool for organizations migrating to NIST PQC standards by automating inventory and risk prioritization. The open-source aspect enhances potential impact and allows community verification. However, the quantum component's contribution remains unproven based on the provided evaluation.
major comments (2)
- The reported metrics (71.98% precision, 100% recall, F1=83.71%) apply exclusively to the regex+LLM detection on the 602 instances; no performance data, objective function, ansatz details, or baselines (e.g., classical CVSS or qubit-count scoring) are supplied for the VQE risk scorer, undermining the central 'quantum-aware' prioritization claim.
- The VQE model is described as using qubit-cost estimates in Qiskit 2.x, but without specification of the variational parameters, ansatz circuit, or training procedure, it is unclear if the scoring is independent or circularly dependent on model choices.
Simulated Author's Rebuttal
We thank the referee for the constructive feedback and for recognizing the potential practical value of the Quantum-Safe Code Auditor framework. We address the two major comments point by point below.
read point-by-point responses
-
Referee: The reported metrics (71.98% precision, 100% recall, F1=83.71%) apply exclusively to the regex+LLM detection on the 602 instances; no performance data, objective function, ansatz details, or baselines (e.g., classical CVSS or qubit-count scoring) are supplied for the VQE risk scorer, undermining the central 'quantum-aware' prioritization claim.
Authors: We acknowledge that the quantitative evaluation in the current manuscript centers on the detection stage (regex plus LLM enrichment), which directly measures the accuracy of identifying quantum-vulnerable primitives. The VQE risk scorer is presented as a complementary prioritization layer that incorporates qubit-cost estimates to rank findings for migration urgency. We agree that the absence of explicit performance metrics, objective-function definition, and classical baselines for this component weakens the claim of quantum-aware prioritization. We will add a dedicated subsection with the VQE objective function, preliminary prioritization results on the same 602-sample set, and direct comparisons against CVSS and simple qubit-count baselines. revision: yes
-
Referee: The VQE model is described as using qubit-cost estimates in Qiskit 2.x, but without specification of the variational parameters, ansatz circuit, or training procedure, it is unclear if the scoring is independent or circularly dependent on model choices.
Authors: We thank the referee for highlighting this lack of implementation detail. The manuscript indeed provided only a high-level reference to Qiskit 2.x qubit-cost estimates. We will expand the methods section to specify the hardware-efficient ansatz (depth-4, 2 qubits per primitive class), the 12 variational parameters, the COBYLA optimizer with 200 iterations, and the fact that qubit-cost estimates are pre-computed via Qiskit’s resource estimator before being fed into the VQE objective; this ordering prevents circular dependence. The revised text will also include a short reproducibility note with the exact circuit diagram and hyper-parameters. revision: yes
Circularity Check
VQE risk scoring reduces to qubit-cost estimates by construction with no independent validation
specific steps
-
fitted input called prediction
[Abstract (risk scoring description) and evaluation paragraph]
"risk scoring via a Variational Quantum Eigensolver (VQE) model implemented in Qiskit 2.x, incorporating qubit-cost estimates to prioritise findings. We evaluate the system across five open-source libraries -- python-rsa, python-ecdsa, python-jose, node-jsonwebtoken, and Bouncy Castle Java -- covering 5,775 findings. On a stratified sample of 602 labelled instances, we achieve 71.98% precision, 100% recall, and an F1 score of 83.71%."
The prioritization output is defined directly from qubit-cost estimates fed into the VQE; the only quantitative results supplied are for the upstream detection pipeline, so the claimed quantum-risk prioritization is statistically forced by the choice of those estimates rather than independently validated.
full rationale
The paper's central quantum-aware contribution is the VQE-based risk scoring for prioritization, yet the reported evaluation (71.98% precision etc. on 602 instances) covers only regex+LLM detection. The VQE component is described solely in terms of its inputs (qubit-cost estimates) with no objective function, ansatz, convergence details, or comparison to classical baselines supplied. This makes the prioritization step reduce to re-expressing the fitted or chosen inputs rather than producing independent evidence.
Axiom & Free-Parameter Ledger
free parameters (1)
- VQE variational parameters
axioms (2)
- domain assumption LLM contextual enrichment reliably classifies usage severity and risk level
- domain assumption Qubit-cost estimates from VQE correlate with actual quantum attack feasibility for prioritization
Lean theorems connected to this paper
-
IndisputableMonolith/Cost/FunctionalEquation.leanwashburn_uniqueness_aczel unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
Stage 3 – VQE Threat Scoring... The VQE circuit encodes algorithm properties—key size, Shor-path qubit cost, Grover speedup factor... Hamiltonian is H=−w_S ·Z_0 ⊗I_1 −w_G ·I_0 ⊗Z_1 +λ·Z_0 ⊗Z_1
-
IndisputableMonolith/Foundation/RealityFromDistinction.leanreality_from_one_distinction unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
We present Quantum-Safe Code Auditor, a quantum-aware static analysis framework that combines (i) regex-based detection... (iii) risk scoring via a Variational Quantum Eigensolver (VQE) model
What do these tags mean?
- matches
- The paper's claim is directly supported by a theorem in the formal canon.
- supports
- The theorem supports part of the paper's argument, but the paper may add assumptions or extra steps.
- extends
- The paper goes beyond the formal theorem; the theorem is a base layer rather than the whole result.
- uses
- The paper appears to rely on the theorem as machinery.
- contradicts
- The paper's claim conflicts with a theorem or certificate in the canon.
- unclear
- Pith found a possible connection, but the passage is too broad, indirect, or ambiguous to say the theorem truly supports the claim.
Forward citations
Cited by 1 Pith paper
-
quantum-safe: Bridging the Post-Quantum Production Gap with a Hybrid-by-Default Python Cryptography Library
The quantum-safe library provides comprehensive hybrid post-quantum crypto features in Python and demonstrates low performance overhead through rigorous benchmarking.
Reference graph
Works this paper leans on
-
[1]
CryptoAPI-Bench: A comprehensive benchmark on Java cryptographic API misuse
Itzel Ami et al. CryptoAPI-Bench: A comprehensive benchmark on Java cryptographic API misuse. InIEEE Symposium on Security and Privacy (S&P), 2022. arXiv:2107.07065
-
[2]
Wei Cheng et al. Post-quantum cryptography migration in telecommunications: Challenges and strategies.Telecom, 6(4):100, 2025
work page 2025
-
[3]
Designing LLM-assisted tools for cryptographic code tasks
Michael Coblenz et al. Designing LLM-assisted tools for cryptographic code tasks. arXiv preprint arXiv:2411.09772, 2024
-
[4]
How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits.Quantum, 5:433, 2021
Craig Gidney and Martin Ekerå. How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits.Quantum, 5:433, 2021
work page 2048
-
[5]
Lov K. Grover. A fast quantum mechanical algorithm for database search. InProceedings of the 28th Annual ACM Symposium on Theory of Computing (STOC), pages 212–219. ACM, 1996
work page 1996
-
[6]
Michele Mosca. Cybersecurity in an era with quantum computers: Will we be ready?IEEE Security & Privacy, 16(5):38–41, 2018
work page 2018
-
[7]
Module-lattice-based digital signature standard (FIPS 204)
National Institute of Standards and Technology. Module-lattice-based digital signature standard (FIPS 204). Technical report, NIST, 2024
work page 2024
-
[8]
Module-lattice-based key-encapsulation mechanism standard (FIPS 203)
National Institute of Standards and Technology. Module-lattice-based key-encapsulation mechanism standard (FIPS 203). Technical report, NIST, 2024
work page 2024
-
[9]
Stateless hash-based digital signature standard (FIPS 205)
National Institute of Standards and Technology. Stateless hash-based digital signature standard (FIPS 205). Technical report, NIST, 2024
work page 2024
-
[10]
Commercial national security algorithm suite 2.0 (CNSA 2.0)
National Security Agency. Commercial national security algorithm suite 2.0 (CNSA 2.0). Technical report, NSA, 2022
work page 2022
-
[11]
Sazzadur Rahaman, Ya Xiao, Sharmin Afrose, Fahad Shaon, Ke Tian, Miles Frantz, Mu- rat Kantarcioglu, and Danfeng Yao. CryptoGuard: High precision detection of crypto- graphic vulnerabilities in massive-sized Java projects. InProceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security (CCS), pages 2455–2472,
work page 2019
-
[12]
arXiv:1806.06881. 12
work page internal anchor Pith review Pith/arXiv arXiv
-
[13]
Martin Roetteler, Michael Naehrig, Krysta M. Svore, and Kristin Lauter. Quantum resource estimates for computing elliptic curve discrete logarithms. InAdvances in Cryptology – ASIACRYPT 2017, pages 241–270. Springer, 2017
work page 2017
-
[14]
Quantum-Safe Code Auditor: Source code, evaluation data, and reproduc- tion scripts
Animesh Shaw. Quantum-Safe Code Auditor: Source code, evaluation data, and reproduc- tion scripts. GitHub repository, 2026
work page 2026
-
[15]
Peter W. Shor. Algorithms for quantum computation: Discrete logarithms and factoring. In Proceedings of the 35th Annual Symposium on Foundations of Computer Science (FOCS), pages 124–134. IEEE, 1994. 13
work page 1994
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.