TL;DR
SALSA VERDE introduces an advanced machine learning attack on the Learning With Errors (LWE) problem, a foundational mathematical puzzle securing post-quantum cryptography. By combining optimized lattice-reduction preprocessing with Transformer models and a novel "two-bit distinguisher," the attack successfully recovers sparse binary, ternary, and narrow Gaussian secrets at larger dimensions and smaller moduli than previous methods. Crucially, the paper provides a new theoretical framework ("NoMod") explaining exactly why and when deep learning models succeed at cracking cryptographic secrets.
What Problem Does This Paper Address?
As quantum computing advances, traditional public-key cryptosystems like RSA risk becoming obsolete due to Shor's algorithm. In response, the cryptographic community is transitioning to Post-Quantum Cryptography (PQC), heavily relying on the hardness of the Learning With Errors (LWE) problem. LWE involves recovering a secret vector $\mathbf{s}$ given a set of noisy linear equations modulo $q$ (i.e., $\mathbf{b} = \mathbf{a} \cdot \mathbf{s} + \mathbf{e} \bmod q$).
To make advanced applications like Homomorphic Encryption (HE) computationally efficient, practitioners often propose using "small, sparse secrets"—vectors where most entries are zero, and the non-zero entries are very small (e.g., binary or ternary). However, these specific parameter choices might introduce subtle security weaknesses. While prior machine learning attacks (SALSA and PICANTE) proved that deep learning could exploit sparse binary secrets, they were severely limited by small dimensions, large moduli, and an inability to handle non-binary secret distributions. SALSA VERDE aims to break through these scaling walls and understand the underlying mechanics of ML-based cryptanalysis.
Methods
The VERDE attack methodology operates in three distinct phases:
- Data Preprocessing (Lattice Reduction): Transformers struggle to learn chaotic, uniformly distributed modular data. VERDE uses the BKZ lattice reduction algorithm to preprocess eavesdropped LWE samples, significantly reducing the coordinate variance of the vector $\mathbf{a}$. The authors introduced several critical optimizations over prior work, including reordering the rows of the lattice matrix, reducing floating-point precision, and implementing adaptive blocksizes with early stopping. This made the preprocessing phase 45x faster and 20% more effective than its predecessor, PICANTE.
- Model Training: The preprocessed samples are fed into a Transformer. The authors experimented with two architectures: a sequence-to-sequence (seq2seq) model with a Universal Transformer decoder, and a simpler encoder-only BERT-like model utilizing rotary word embeddings and an auxiliary Earth Mover’s Distance (EMD) loss function. The network is trained to predict the scalar $b$ given the vector $\mathbf{a}$.
- Secret Recovery via a Two-Bit Distinguisher: Once the model begins to learn, a distinguisher queries it with slightly perturbed inputs ($\mathbf{a}_{\text{test}}$ vs $\mathbf{a}_{\text{test}} + K\mathbf{e}_i$). If the model's predictions remain unchanged, the corresponding secret entry $s_i$ is likely zero. To handle ternary ($-1, 0, 1$) and Gaussian secrets, the authors developed a two-bit distinguisher that analyzes how swapping or shifting pairs of coordinates impacts model predictions, allowing them to cluster non-zero entries by their actual values.
Datasets
The paper relies entirely on synthetically generated LWE datasets tailored to specific security parameters:
- Dimensions ($n$): 256, 350, and 512.
- Moduli ($q$): Ranging from large moduli down to near-real-world small moduli ($\log_2 q = 12$).
- Secret Distributions: Sparse binary, sparse ternary, and narrow Gaussian ($\sigma = 3$). For each attack instance, an initial pool of $4n$ LWE samples sharing the same secret is resampled and preprocessed to generate a training dataset of 4 million samples.
Key Insights and Ideas
- The "NoMod" Effect: The authors discovered that Transformers do not actually learn how to perform modular arithmetic. Instead, the attack succeeds because the lattice preprocessing reduces data variance so drastically that a large percentage of the training samples can be computed without triggering the modulus wrap-around. They define this metric as NoMod, demonstrating empirically that secret recovery consistently succeeds once the NoMod percentage in the training data crosses a threshold of ~67%.
- Ternary is Not Harder Than Binary for ML: In classical lattice cryptanalysis, ternary secrets are significantly harder to recover than binary ones. However, VERDE recovers ternary secrets just as effectively as binary ones because the standard deviation formula governing the NoMod effect remains identical for both distributions.
- The Scaling Law: The authors derived a heuristic scaling law showing that successful secret recovery depends primarily on the sparsity ($\sqrt{h}$) and the standard deviation of the preprocessed data ($\sigma_a$). This provides a predictable mathematical boundary for ML attack capabilities.
Key Results
- Higher Dimensions: VERDE successfully pushed ML cryptanalysis to dimension $n = 512$ (at $\log_2 q = 41$), recovering binary and ternary secrets with up to 11% sparsity ($h=63$).
- Smaller Moduli: For $n = 256$, the attack successfully scaled down to a small modulus of $\log_2 q = 12$, a setting relevant to real-world lightweight PQC proposals.
- Distribution Agnostic: As shown in Figure 2, VERDE achieved comparable recovery performance for both binary and ternary secrets across various moduli, though narrow Gaussian secrets remained notably more challenging.
- Speed and Efficiency: Compared to classical unique Shortest Vector Problem (uSVP) attacks, VERDE recovered secrets significantly faster in several sparse settings (e.g., hours versus weeks), albeit by leveraging massive parallel compute during the preprocessing phase.
Limitations and Future Work
Despite these impressive leaps, the authors openly acknowledge that VERDE cannot yet break standardized production-grade PQC schemes (such as Kyber or Dilithium), which utilize much larger dimensions ($n \ge 768$) and non-sparse secrets.
The primary bottleneck remains the Transformer's fundamental inability to handle modular reduction natively. The authors suggest two major avenues for future research:
- Designing novel neural network architectures explicitly optimized for modular arithmetic.
- Developing alternative, non-lattice-based preprocessing techniques capable of concentrating random vector distributions without the steep computational cost of traditional lattice reduction algorithms.
Summary updated