[Paper Review] SALSA: Attacking Lattice Cryptography with Transformers
This paper introduces SALSA, a novel machine learning attack on Learning With Errors (LWE) lattice-based cryptography using transformers. It demonstrates that transformers can learn modular arithmetic and, when combined with statistical cryptanalysis, can recover sparse binary secrets from LWE instances up to dimension n=128, marking the first successful use of transformers for cryptanalysis of lattice problems.
Currently deployed public-key cryptosystems will be vulnerable to attacks by full-scale quantum computers. Consequently, "quantum resistant" cryptosystems are in high demand, and lattice-based cryptosystems, based on a hard problem known as Learning With Errors (LWE), have emerged as strong contenders for standardization. In this work, we train transformers to perform modular arithmetic and combine half-trained models with statistical cryptanalysis techniques to propose SALSA: a machine learning attack on LWE-based cryptographic schemes. SALSA can fully recover secrets for small-to-mid size LWE instances with sparse binary secrets, and may scale to attack real-world LWE-based cryptosystems.
Motivation & Objective
- To investigate whether transformers can learn modular arithmetic and perform computations over finite fields.
- To develop a machine learning-based attack on the Learning With Errors (LWE) problem, a foundational assumption in post-quantum cryptography.
- To demonstrate that transformers can distinguish LWE samples from random data and recover secret vectors.
- To design practical algorithms for secret recovery using partially trained models and statistical techniques.
- To explore the feasibility of scaling such attacks to real-world lattice-based cryptosystems.
Proposed method
- Train a transformer model to predict the noisy inner product b = a·s + e mod q from input vectors a, using synthetic LWE samples.
- Leverage the model's ability to perform modular arithmetic on integers and vectors as a core computational primitive.
- Use the trained model to distinguish LWE instances from uniformly random data with high accuracy.
- Develop two secret recovery algorithms: one based on statistical analysis of model predictions, and another using iterative refinement with partial model outputs.
- Combine half-trained models with statistical techniques to reduce data and time requirements for secret recovery.
- Apply the attack to LWE instances with sparse binary secrets, exploiting structural weaknesses in the secret distribution.
Experimental results
Research questions
- RQ1Can transformers be effectively trained to perform modular arithmetic over finite fields?
- RQ2Can a transformer-based model detect the statistical difference between LWE samples and random data?
- RQ3Can the model's predictions be used to reconstruct the secret vector s in LWE with sparse binary secrets?
- RQ4To what extent can partial or low-accuracy models be used to mount a practical secret recovery attack?
- RQ5Can this approach scale to larger LWE instances, such as those used in real-world post-quantum cryptosystems?
Key findings
- Transformers can learn and perform modular arithmetic on integers and vectors with high accuracy, even in finite fields.
- The trained model achieves high accuracy in distinguishing LWE samples from random data, indicating it captures the underlying structure of the LWE problem.
- SALSA successfully recovers sparse binary secrets in LWE instances up to dimension n=128, matching the scale of the Darmstadt LWE challenge.
- The attack remains effective even with partially trained models, reducing the required data and training time.
- Secret recovery algorithms based on statistical analysis of model outputs enable efficient attack with minimal model accuracy.
- The results suggest that larger transformer architectures could scale to higher-dimensional LWE instances, such as n=256, used in practice.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.