SALSA VERDE: a machine learning attack on Learning with Errors with sparse small secrets

Cathy Yuanchen Li, Jana Sotáková, Emily Wenger, Zeyuan Allen-Zhu, François Charton, Kristin E. Lauter

Introduction

As the cryptographic community transitions toward Post-Quantum Cryptography (PQC) to safeguard against future quantum computing threats, the Learning With Errors (LWE) problem has emerged as a foundational mathematical pillar. LWE involves recovering a secret vector $s$ from noisy linear equations $b = a \cdot s + e \pmod q$. While generally robust, specific implementations—particularly in Homomorphic Encryption (HE)—utilize "sparse small secrets" to maintain computational efficiency. SALSA VERDE introduces a novel machine learning-based attack targeting these specific parameter choices, extending the capabilities of previous ML methods to larger dimensions and more complex secret distributions like ternary and Gaussian.

The SALSA VERDE Pipeline

The attack architecture consists of a three-stage pipeline that integrates classical lattice reduction with modern Transformer models.

The SALSA VERDE attack pipeline, illustrating data preparation, model training, and secret recovery stages.
  1. Data Preprocessing: Raw LWE samples are preprocessed using the BKZ (lattice reduction) algorithm. This step reduces the variance of the input vectors, making the underlying linear relationship more discernible for the neural network. SALSA VERDE optimizes this stage, achieving a 40x speedup over previous iterations through adaptive precision and matrix reordering.
  2. Transformer Training: A Transformer model is trained on the reduced samples to predict the value $b$ from vector $a$. The model does not require perfect accuracy; it only needs to capture enough signal to distinguish secret bit relationships.
  3. Secret Recovery: Once training shows progress, a "two-bit distinguisher" is employed. By analyzing model responses to input permutations, the attack can recover binary, ternary (-1, 0, 1), and narrow Gaussian secrets.

Key Insights: The NoMod Theory

A significant contribution of this work is the "NoMod" theory, which provides a predictive framework for attack success. The researchers observed that the Transformer's ability to learn is tied to the proportion of training samples where the calculation $a \cdot s$ does not "wrap around" the modulus $q$.

Histogram showing the relationship between the proportion of NoMod training data and attack success.

Empirical evidence suggests a clear threshold: when more than 67% of the training data consists of "NoMod" samples, the model typically succeeds in recovering the secret. This observation establishes a scaling law that helps determine the vulnerability of specific LWE parameters to ML-based cryptanalysis.

Experimental Results

The researchers evaluated SALSA VERDE on synthetic LWE instances across various dimensions ($n=256, 350, 512$) and moduli. Key findings include:

  • Increased Scalability: The attack successfully scaled to dimension $n=512$, surpassing the previous ML limit of $n=350$.
  • Competitive Performance: For $n=256$, the attack recovered secrets in 3 to 15 hours, often outperforming classical uSVP attacks which can take hundreds of hours or fail within similar time constraints.
  • Distribution Versatility: SALSA VERDE achieved the first successful ML-based recovery of ternary and Gaussian secrets, which are critical for real-world Homomorphic Encryption standards.

Conclusion and Future Directions

While SALSA VERDE represents a significant leap in ML-driven cryptanalysis, it does not yet threaten the primary NIST PQC standards like CRYSTALS-Kyber, which utilize larger dimensions and different noise profiles. The attack's effectiveness remains sensitive to secret sparsity; as the number of non-zero entries increases, the problem becomes exponentially harder. Future research may focus on developing neural architectures specifically optimized for modular arithmetic or reducing the reliance on classical lattice-based preprocessing to create a "pure" machine learning attack.

Summary updated

BibTeX
@article{li2023salsa,
  author = {Cathy Yuanchen Li and Jana Sotáková and Emily Wenger and Zeyuan Allen-Zhu and François Charton and Kristin E. Lauter},
  title = {{SALSA VERDE: a machine learning attack on Learning with Errors with sparse small secrets}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2023},
}
Figure