arXiv:2608.25122cs.CRAug 2026

Manuscript Offprint

arXiv:2608.25122

Static Detection of Post-Quantum Cryptographic Algorithms in Stripped Binaries for Digital Forensic Examination and Migration Assurance

Muhammad Shaheer Bin Junaid

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Muhammad Shaheer Bin Junaid D◯\textcircled{D}

Independent Researcher

Karachi, Pakistan

contact@mshaheerbjunaid.com

Abstract— Identifying which post-quantum algorithm a compiled binary implements is a core problem in binary analysis, and it becomes acute once the binary has been stripped, statically linked, and optimised, since the symbols, library dependencies, and runtime behaviour that conventional discovery tools rely on are then gone. This paper presents Kestrel, a static analysis method that identifies an algorithm from the number-theoretic transform constant tables its arithmetic depends on, and applies it to the standardised lattice schemes ML-KEM and ML-DSA, for which no prior method could confirm, from a shipped binary alone, that a quantum-vulnerable algorithm had been replaced by its approved successor. The fingerprints Kestrel derives from public scheme parameters are localised by a normalisation-and-multiset-matching procedure; the false-positive probability is established analytically. Across four independent implementation lineages and all build transformations, including compiler-level obfuscation, Kestrel achieved recall of 128 of 128 with zero false positives. Applied to 6,224 binaries on a production Linux system, it disclosed twelve uncatalogued programs containing ML-KEM, among them the OpenSSH key-exchange program and the container-management stack, where post-quantum code had entered production through the language runtime without the awareness of the projects distributing them. Kestrel distinguishes genuine implementations from advertised claims not backed by the underlying code, attributes each detection to its originating codebase, and, in a forensic disk-image trial, recovered a detection from unallocated space after the deleted binary could no longer be reconstructed. It thus provides a practical basis for cryptographic migration assurance, compliance verification, software supply-chain inspection, and post-quantum forensic examination.

Keywords: Post-Quantum Cryptography; Cryptographic Inventory; Binary Analysis; Static Analysis; Digital Forensics; ML-KEM; ML-DSA.

I. Introduction

The migration to post-quantum cryptography depends on a preliminary step whose difficulty is easily underestimated. Before an organisation can replace the algorithms that a quantum computer would defeat, it must first locate every instance of those algorithms across software accumulated over decades of development. The principle underlying this requirement, restated throughout current migration guidance, is that cryptography which cannot be observed cannot be replaced. A dedicated category of tooling, the cryptographic discovery scanner, exists to produce the necessary inventory, and national standards bodies now treat automated discovery as the foundation of the entire transition.

These tools are, without exception, oriented in a single direction. They identify RSA, elliptic-curve schemes, and Diffie-Hellman, since these are the primitives rendered insecure by Shor's algorithm [4] and therefore the ones a migration programme must remove. That orientation was appropriate while the task was removal, but it leaves a blind spot that is only now becoming apparent. When such a scanner is asked the converse question, namely whether a given binary contains ML-KEM or ML-DSA, it returns no answer, because no fingerprints exist for algorithms standardised only in 2024. The discipline has concentrated on identifying what must be withdrawn, and no instrument confirms what has actually been deployed in its place.

This deficiency ceased to be a purely theoretical concern in 2026. A ransomware family designated Kyber was documented [19] whose Windows variant genuinely encapsulates its AES-256 file key with ML-KEM-1024 in combination with X25519, while a related variant targeting virtualisation hosts claims post-quantum protection but in fact relies on classical RSA. Post-quantum cryptography has thus become an offensive capability in deployed malware, and an examiner confronted with such a sample possesses no established means to identify the primitive, document it in a report, or distinguish a genuine implementation from a fraudulent claim.

The same period produced a corresponding regulatory obligation. Executive Order 14412, Securing the Nation Against Advanced Cryptographic Attacks, signed on 22 June 2026 [18], directs federal agencies to transition their high-value and high-impact systems to post-quantum cryptography, employing it for key establishment by 31 December 2030 and for digital signatures by 31 December 2031, and requires the acquisition regulations to oblige covered contractors to conform to the post-quantum standards on the same schedule. A migration subject to a statutory deadline gives rise to a verification problem that current practice cannot resolve. When a vendor delivers a binary together with an assurance that it has migrated to ML-KEM, no established procedure confirms that claim against the artefact itself rather than against the vendor's declaration. Source-level scans reveal intended use rather than what was shipped; network scans observe traffic rather than the implementation within the file; configuration scans record settings rather than code. As one binary-analysis vendor states in its own technical material, the common approaches to cryptographic inventory each leave the compiled binary itself unexamined [29].

This paper resolves that gap for the lattice schemes that predominate in current deployment, through a method implemented in a tool named Kestrel. The principle on which it rests is well established, whereas its application is novel. ML-KEM and ML-DSA perform their polynomial arithmetic [1], [2] by means of the number-theoretic transform, which requires a table of precomputed constants, namely the powers of a fixed root of unity modulo a fixed prime. These constants are not incidental to the computation; the algorithm produces incorrect results in their absence, so they cannot be removed, and because they are stored as data rather than as executable code, they persist through the transformations that eliminate every signal a name-based scanner depends upon. Compiler optimisation rewrites instructions while leaving constant tables unaltered; symbol stripping removes names while leaving data intact; static linking incorporates the table into the binary rather than excluding it. The function name may be removed, whereas the constant 3329 cannot. To the best of our knowledge, no prior method identifies a post-quantum primitive from these constants within a stripped, statically linked binary, since existing work relies on symbols, library dependencies, runtime behaviour, or network traffic, none of which survives the conditions Kestrel is designed to address. Kestrel is released as open-source software, with its generator, detector, corpus builder, and obfuscation pass provided in full [30].

This paper makes four contributions. First, it defines a derivation procedure that generates the complete fingerprint set for any transform-based lattice scheme from its public parameters alone, emitting every representation in which shipped implementations store the constants, so that coverage does not depend on the manual enumeration of implementations. Second, it presents a detector built upon that procedure, employing a normalisation step and multiset scoring that accommodate the reordered and Montgomery-form layouts produced by optimised builds, and whose false-positive rate can be stated as a quantified value rather than merely asserted. Third, it establishes an implementation-lineage attribution result, confirmed by direct inspection of source code, demonstrating that the number of constant tables a binary carries separates the principal deployed lineages at a granularity that a forensic examiner can defend, which is precisely the form of provenance an investigation requires. Fourth, it articulates the two operational settings the method serves, forensic examination and migration assurance, together with a candid account of its capabilities and limitations. The principle is not specific to post-quantum schemes. Any algorithm whose correctness depends on stored, invariant constants leaves the same kind of fingerprint, so constant-table detection is a general technique for identifying algorithms in stripped binaries.

The paper does not claim that constant matching is itself a new technique. Signature-based tools have located the AES substitution box by its fixed bytes for two decades. The novelty is more specific and defensible: the construction and validation of the first fingerprint set and detector for post-quantum primitives in stripped binaries, at the point at which such primitives have appeared in malware and a federally mandated migration deadline has rendered their verification a matter of compliance. The technique is long established; its application to this problem is not.

The evaluation confirms this on software the method had not previously encountered. Kestrel identifies ML-KEM and ML-DSA at full table match across four independent toolchains and every ordinary build transformation, including symbol stripping, static linking, and a genuine obfuscation pass. A sweep of 6,224 binaries from a production system produced no false positives and, in the same pass, disclosed twelve distinct uncatalogued programs containing post-quantum cryptography, among them a live OpenSSH key exchange and the container-management stack, in which ML-KEM had entered production through the language runtime without the awareness of the projects distributing it. The detector distinguished a genuine implementation from one that merely advertises post-quantum protection, attributed each finding to its source lineage by table configuration alone, and, in a forensic disk-image trial, recovered a detection from unallocated space after the deleted binary had itself become unrecoverable. In contrast to the classical primitives that preceded it, post-quantum cryptography leaves a fingerprint that ordinary compilation cannot remove.

References (41)