Bridging Crypto with ML-based Solvers: the SAT Formulation and Benchmarks

Xinhao Zheng, Xinhao Song, Bolin Qiu, Yang Li, Zhongteng Gui, Junchi YanNeurIPS 2025

TL;DR

This paper introduces SAT4CryptoBench, the first comprehensive benchmark for evaluating machine learning (ML)-based solvers on cryptographic SAT problems. It highlights that ANF representations are superior to CNF for ML models in this domain and proposes BASIN, a novel bitwise solver that excels with direct plaintext-ciphertext inputs, especially for complex cryptographic structures.

What Problem Does This Paper Address?

The paper tackles a significant challenge in applying ML to cryptanalysis: the lack of a standardized way to evaluate ML-based SAT solvers. Current approaches suffer from inconsistent input formats, varying ML integration strategies, and a scarcity of standardized datasets for cryptographic SAT instances. These issues make it difficult to compare different methods fairly and hinder progress in developing effective ML-driven cryptanalytic tools. Cryptographic SAT problems also have unique structural properties that differ from general SAT problems, further complicating evaluation.

Methods

The authors introduce SAT4CryptoBench, a benchmark designed to address these issues. It categorizes ML integration into three levels:

  1. Standalone Distinguisher: ML models that directly predict satisfiability or cryptographic properties without using traditional SAT solvers.
  2. Heuristic Enhancement: ML components integrated into traditional CDCL solvers to guide heuristic decisions (e.g., variable selection, clause learning). This includes solvers with "internal learnable modules" (learning happens within the solver) and "neural network external modules" (pre-trained networks used as components).
  3. Hyperparameter Optimization: Using ML to find optimal hyperparameters for traditional SAT solvers to adapt them to specific cryptographic problem distributions.

A key contribution is the proposal of BASIN (Bitwise Arithmetic Solver with Initialization by Neural network), a novel bitwise solver that takes plaintext-ciphertext bitstrings as input. BASIN uses neural-guided initialization for a guided bitwise search, aiming to improve efficiency in key recovery.

The paper also explores different input representations for SAT problems:

  • CNF (Conjunctive Normal Form): The standard representation for SAT solvers.
  • ANF (Arithmetic Normal Form): Polynomial equations over GF(2), which the authors argue better capture cryptographic structures.
  • Plaintext-Ciphertext Bitstrings: Direct input of cryptographic data.

Datasets

The paper introduces SAT4CryptoBench, a benchmark comprising diverse SAT datasets derived from various cryptographic algorithms. These datasets include:

  • Simon cipher: With varying rounds (3, 6, 10, 12) and block sizes (8, 16, 32 bits).
  • Cipher1: A widely used but anonymized cryptographic scheme.
  • MD4, SHA-1, SHA-256: Standard cryptographic hash functions.

Datasets are provided in both CNF and ANF formats, and for some, the original plaintext-ciphertext bitstrings are also retained.

Key Insights and Ideas

  • ANF is King for ML in Crypto-SAT: ANF-based neural networks significantly outperform CNF-based networks in learning cryptographic features. This is likely because ANF's polynomial structure more naturally represents the algebraic dependencies found in cryptographic operations.
  • Generalization is a Hurdle: Current ML techniques struggle to generalize well across different cryptographic algorithms and instance sizes. This suggests a need for more specialized models or adaptive strategies.
  • Input Representation Matters (A Lot): The way a cryptographic problem is represented as a SAT instance has a profound impact on solver performance. Direct input formats like plaintext-ciphertext bitstrings can be more effective for complex problems than traditional CNF or even ANF.
  • Heuristics are Key for Complex Problems: ML-based heuristic enhancements show substantial advantages over traditional solvers on more complex cryptographic instances, suggesting that learned branching heuristics can effectively capture structural patterns.
  • Hyperparameter Optimization Pays Off: ML-driven hyperparameter optimization can significantly reduce solving time for traditional SAT solvers on cryptographic instances.

Key Results

  • Standalone Distinguisher: ANF-based networks achieved prediction accuracies approaching 1 for some Simon datasets, significantly outperforming CNF-based models which showed no significant impact on outcomes.
  • Heuristic Enhancement: ML-enhanced solvers, particularly those with internal learnable modules (like BMM-enhanced variants), showed significant advantages on complex instances (e.g., Cipher-12, Simon-12-32-64), outperforming their base versions and traditional solvers. For example, MapleLCMDist-BMM solved Cipher-12 in 368.26s.
  • Hyperparameter Optimization: ML-based optimization (HEBO and EasyNAS) achieved up to a 62.5% reduction in solving time on the Cipher-12 dataset for Kissat.
  • Input Representation: The proposed BASIN solver, using plaintext-ciphertext bitstrings, achieved the best performance on higher-round instances, significantly outperforming CNF and ANF-based methods. For example, on Simon-12-32-64, BASIN achieved 29.67s, while the best CNF solver (Kissat-E) took 595.47s and the best ANF solver (WDSat-MVC) took 364.96s.

Limitations and Future Work

The authors acknowledge several limitations:

  • Focus on Formulation and Analysis: The paper primarily focuses on problem formulation and empirical analysis rather than proposing novel solver architectures or optimization methods.
  • Generalization Issues: Current ML models struggle to generalize across different algorithms and instance sizes.
  • Computational Overhead: ML integration can introduce overhead that may offset benefits on simpler tasks.

Future work should focus on developing more adaptive, lightweight, and generalizable ML techniques, and further exploring input representation learning to address these challenges. The authors hope SAT4CryptoBench will serve as a foundation for future research in ML-based SAT solving and cryptanalysis.

Summary updated

BibTeX
@inproceedings{zheng2025bridging,
  author = {Xinhao Zheng and Xinhao Song and Bolin Qiu and Yang Li and Zhongteng Gui and Junchi Yan},
  title = {{Bridging Crypto with ML-based Solvers: the SAT Formulation and Benchmarks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=BmwbEWRkyE},
}
Figure