SAT Audits for Public-Key-Unbound Ciphertext Generation

Modern encryption is usually hybrid: a public-key machinery called a key encapsulation mechanism (KEM) lets two parties agree on a fresh shared secret, and a symmetric cipher then uses that secret to protect the actual message. A recurring and severe flaw in this setting is that the components are composed without tight binding. When ciphertext generation does not genuinely depend on the recipient's public key, an adversary can isolate, bypass, or algebraically cancel parts of the system. This is not hypothetical: Chen, Huang, and Yung show that subverted KEM software whose ciphertexts are only loosely bound to the public key lets an eavesdropper recover session keys from just two consecutive ciphertexts, provably undetectably to legitimate users (Subvert KEM to Break DEM: Practical Algorithm-Substitution Attacks on Public-Key Encryption); Tian, Huang, and Yang break knapsack-plus-pairing signature schemes because message hashes and identity scalars are not securely bound in the verification equation, so a single intercepted signature enables polynomial-time forgery (Practical certificateless short signature scheme, On the security of an enhanced signature scheme); and Lee, Lee, and Park break the post-quantum KEM NTRU+ because its decoder is not "rigid" for adversarial inputs, recovering key material with an average of only four decapsulation queries per component (A Novel CCA Attack for NTRU+ KEM).

Every one of these breaks was found by hand, after publication, against schemes that carried formal security proofs. Meanwhile, SAT solvers — programs that decide whether an enormous system of Boolean constraints can be satisfied, using conflict-driven clause learning (CDCL) to prune the search — have become a mature automated cryptanalysis tool for symmetric primitives: state recovery on CAESAR authenticated ciphers (SAT-based Cryptanalysis of Authenticated Ciphers from the CAESAR Competition), backdoor-guided key search on AES and Magma (On Cryptographic Attacks Using Backdoors for SAT), and programmatic solvers that beat black-box baselines on SHA-256 (CDCL(Crypto) SAT Solvers for Cryptanalysis). No SAT-based tool has ever been pointed at a public-key or hybrid scheme; the only automated analysis of such schemes, ZooCrypt, is symbolic and assumes the code runs faithfully (Automated Analysis and Synthesis of Padding-Based Encryption Schemes). This proposal closes that gap.

Core Claim

The "unbound component" vulnerabilities above are not accidents requiring case-by-case human ingenuity; they are decidable relational properties of the implementation's circuit, and a constraint solver can detect them automatically before deployment. Concretely, we will build a SAT/SMT auditor that takes a KEM implementation (honest or possibly subverted) and answers three queries. First, an independence check: which output wires of the encapsulation routine are functionally independent of the public key, using a two-copy encoding in the spirit of self-composition. Second, an exfiltration check, the centerpiece: unroll the implementation over two sessions, treat the subversion key as a shared symbolic constant, and ask the solver whether the observed transcript alone determines the first session key. Writing $c_i$ for the ciphertext of session $i$, $K_i$ for the session key, and $s$ for a key baked into the implementation, the query is whether there exist two runs $A, B$ with

$$s_A = s_B \;\wedge\; (c_1, c_2)_A = (c_1, c_2)_B \;\wedge\; (K_1)_A \neq (K_1)_B.$$

If this formula is unsatisfiable, the two-ciphertext transcript pins down the session key — precisely the exfiltration Chen et al. construct by hand (Subvert KEM to Break DEM: Practical Algorithm-Substitution Attacks on Public-Key Encryption); a follow-up solver call on a concrete transcript then synthesizes the attacker's recovery procedure, and model counting on the projection onto $K_1$ (the machinery of SAT-Based Analysis and Quantification of Information Flow in Programs) quantifies the leak in bits. Third, a rigidity check in the CICO (constrained-input, constrained-output) style of Dwivedi et al. (SAT-based Cryptanalysis of Authenticated Ciphers from the CAESAR Competition): does there exist a crafted non-binary ciphertext that the decoder processes instead of rejecting, and can a bounded sequence of decapsulation queries be unrolled to separate key bits — the NTRU+ failure mode of Lee et al. (A Novel CCA Attack for NTRU+ KEM) rediscovered automatically.

Research Program

The build has four parts. The first is an encoder that turns KEM reference implementations into bit-vector formulas and then CNF, combining the bounded unwinding of C code used by Klebanov et al. (SAT-Based Analysis and Quantification of Information Flow in Programs) with the translation-tool approach of Semenov et al. (On Cryptographic Attacks Using Backdoors for SAT). Lattice KEMs involve polynomial arithmetic that would explode a naive bitwise encoding, so the second part extends the programmatic-solver architecture of Nejati and Ganesh (CDCL(Crypto) SAT Solvers for Cryptanalysis) with C++ callbacks that propagate number-theoretic-transform and modular-reduction reasoning on demand instead of eagerly, addressing the semantic-loss and formula-explosion problems they identified. The third part adapts the Tabu-search backdoor selection of Semenov et al. to choose which internal variables to expose when full encodings are too large, replacing their wall-clock-sensitive resistance function with a deterministic propagation-count surrogate, since they themselves flag solver and hardware sensitivity as a limitation. The fourth part is a lightweight demonstration that the same relational machinery generalizes beyond KEMs: encoding the exponent arithmetic of the Tian et al. verification equations as a small SMT problem and asking the solver to rediscover the linear cancellation $V^* = \frac{\lambda^*}{\lambda}V$ and the public-key scaling $Q_{ID'} = \frac{ID'}{ID}Q_{ID}$ (Practical certificateless short signature scheme). A natural extension, directly attacking the open problem Chen et al. leave on stateless subversion, is to run the exfiltration query with the state variables existentially quantified rather than chained, testing whether statelessness suffices for two-ciphertext leakage.

Proposed Experiments

The evaluation corpus has four tiers: honest reference implementations of the KEM families Chen et al. show to be structurally vulnerable (Cramer-Shoup, Kurosawa-Desmedt, Hofheinz-Kiltz, and hash-proof-system KEMs); the NTRU+ reference C implementation at both broken parameter sets, ntruplus576 and ntruplus768 (A Novel CCA Attack for NTRU+ KEM); ground-truth positives, our own reimplementations of the Chen et al. subverted encapsulation; and negative controls, KEM variants with explicit public-key re-encryption binding. Primary metrics are detection rates against ground truth, solver wall-clock and formula size as a function of parameter size (with a parameter-reduced scaling curve, mirroring the round-reduced methodology of Dwivedi et al., who report practical recovery on ASCON-128a at 2 of 8 rounds in seconds at complexity $2^{32}$, and $2^{108}$ for ICEPOLE at 4 of 6 rounds (SAT-based Cryptanalysis of Authenticated Ciphers from the CAESAR Competition)), leakage in min-entropy bits from projection-aware model counting, and — for the rigidity check — the number of decapsulation queries in the solver-synthesized attack, compared against the manually derived average of four queries per component reported by Lee et al. As a calibration point for the counting machinery, Klebanov et al. report measuring a 13.58-bit leak out of 13.93 bits of min-entropy on an image-processing benchmark, and analyzing a Linux kernel routine almost instantaneously where self-composition took over an hour (SAT-Based Analysis and Quantification of Information Flow in Programs); we expect our KEM encodings to be far larger, and the scaling study is where we expect to be pushed hardest.

Baselines

The naive reference point is black-box statistical randomness testing of ciphertext and coin streams, NIST-suite style, over honest and subverted implementations. This is the "do nothing" audit a deployment might actually run; Chen et al. prove their subversion undetectable to legitimate users (Subvert KEM to Break DEM: Practical Algorithm-Substitution Attacks on Public-Key Encryption) — I note the correct id again: Subvert KEM to Break DEM: Practical Algorithm-Substitution Attacks on Public-Key Encryption — so we expect chance-level detection, establishing that the flaw is invisible from outputs alone and that white-box structural analysis is necessary.

The strongest existing automated competitor is ZooCrypt, the symbolic analysis and synthesis toolset for padding-based public-key encryption of Barthe et al. (Automated Analysis and Synthesis of Padding-Based Encryption Schemes). It is formidable on its own ground: the paper reports finding IND-CPA proofs in about 0.1 ms and IND-CCA proofs in 0.5 ms across a benchmark of over 1.1 million synthetic schemes, correctly analyzing about 80% of CCA schemes and failing on the roughly 20% non-redundant ones. We will run ZooCrypt on every corpus scheme expressible in its grammar, on the same machine and with at least our solver's time budget, so the comparison is generous to it. Beating it means flagging every ground-truth-positive implementation that ZooCrypt certifies or leaves unflagged — which, given that ZooCrypt assumes faithful execution and cannot model stateful coin chaining or bit-level masking, we expect to be all of them. That experiment is the decisive one for the whole proposal.

The methodologically closest competitor is the QIF pipeline of Klebanov et al. (SAT-Based Analysis and Quantification of Information Flow in Programs): CBMC-based unwinding plus projection-aware #SAT. We will run it on single-session unrollings of our implementations without the multi-session subversion modeling and without CICO attack synthesis. Beating it means detecting the two-ciphertext exfiltration where the single-session analysis measures near-zero leakage, at comparable or better runtime; if single-session QIF already catches the ASA, our contribution would shrink to an encoding exercise and we would say so.

Finally, an ablation isolates our key ingredient, domain-aware programmatic reasoning: the identical encodings fed to an off-the-shelf CDCL solver with no callbacks. The precedent is direct — on 25-round SHA-256 collision finding, Nejati and Ganesh report their programmatic solver roughly 2.3x faster than stock MapleSAT and completing instances the baseline could not finish within a 24-hour limit (CDCL(Crypto) SAT Solvers for Cryptanalysis). If our programmatic extensions do not beat the black-box solver on NTRU+ encodings by a clear margin, the domain-aware machinery is not earning its cost.

Why not just…?

Why not just use ZooCrypt's symbolic analysis? It is dramatically faster than any SAT pipeline — 0.1 ms proofs versus hours of solving — and it does find algebraic distinguishing attacks. But it operates on an abstract grammar of XOR, hashes, and trapdoor permutations under an honest-execution assumption: it cannot represent a subverted encapsulation routine chaining coins across sessions, nor the & 0x1 masking detail that broke NTRU+ (A Novel CCA Attack for NTRU+ KEM), and it already fails on about 20% of its own test set for want of random-oracle reasoning (Automated Analysis and Synthesis of Padding-Based Encryption Schemes). Our head-to-head experiment settles this empirically rather than by argument.

Why not just do manual cryptanalysis? For the four named KEM families, the manual answer already exists (Subvert KEM to Break DEM: Practical Algorithm-Substitution Attacks on Public-Key Encryption), so on those the tool adds confirmation, not discovery — we are honest about that. The case for automation is the track record of human review: Su's schemes and NTRU+ carried proofs through peer review and into competitions before being broken (Practical certificateless short signature scheme, A Novel CCA Attack for NTRU+ KEM), and Semenov et al. note that manual guess-and-determine analysis demands significant expert effort per target (On Cryptographic Attacks Using Backdoors for SAT). Our held-out test — detection of subverted and non-rigid variants the tool designers did not plant — is what would demonstrate genuine auditing rather than replaying known answers.

Why not just run statistical randomness tests on the output? This is the naive baseline above, and the theory says it must fail: Chen et al. formally prove their subverted ciphertexts and coins are indistinguishable from honest ones to any legitimate observer (Subvert KEM to Break DEM: Practical Algorithm-Substitution Attacks on Public-Key Encryption). Detection requires reasoning about the internal relations among software state, subversion key, and public key — a structural, white-box task, which is exactly what the solver does. We still run the tests to quantify the blindness.

Why not just dump the scheme into an off-the-shelf SAT solver? Because the record shows this fails on far easier symmetric targets: Dwivedi et al. report that ACORN's long XOR chains stall CDCL solvers outright, with no numerical complexity reported for it precisely because of this resistance (SAT-based Cryptanalysis of Authenticated Ciphers from the CAESAR Competition), and stock MapleSAT hit a 24-hour timeout on 25-round SHA-256 where the programmatic solver succeeded (CDCL(Crypto) SAT Solvers for Cryptanalysis). Lattice polynomial arithmetic would be strictly worse. This is why programmatic propagation is a design pillar and its own ablation, not an afterthought.

Decisive Checks

Three outcomes decide the proposal. The auditor must flag every reimplemented subverted encapsulation and every non-rigid decoder while clearing the negative controls; it must rediscover the NTRU+ rigidity attack with a query count within a small factor of the manually derived four queries per component (A Novel CCA Attack for NTRU+ KEM); and its exfiltration verdicts must match the known two-ciphertext recovery of Chen et al. on the vulnerable KEM families (Subvert KEM to Break DEM: Practical Algorithm-Substitution Attacks on Public-Key Encryption). The main risk is scaling: if full-size ntruplus768 encodings do not solve within a 24-hour budget, we will report the largest tractable parameter set and the scaling curve, and treat the distance to full size as the honest measure of what remains open.