Lattices
This section was made using A Gentle Tutorial for Lattice-Based Cryptanalysis and the Cryptohack lattice section.
Lattices definition
Given linarly independent vectors , the lattice generated by is the set of all integer linear combinations of :
Lattice based problems
Many cryptography problems can be reduced to lattice-based problems. These probleme can then be seen as a lattice problem, usually SVP or CVP which can be solved using the LLL algorithm.
| Lattice-based problems |
|---|
| Finding small roots of polynomials |
| Knapsack problem |
| Hidden number problem |
| Extended HNP |
Finding small roots of polynomials
Finding small roots of polynomials modulo a composite integer can be solved using Coppersmith’s method.
Given an integer and a monic polynomial of degree with coefficients in , find all such that and . This means solving:
This problem can be solved using the LLL algorithm on:
Implementation
See this python script for a quick implementation of this. If you need to be more precise, use this github repository
Subset sum problem
The subset sum problem is a special case of the knapsack problem.
Given a set of integers and a target integer , find a subset such that
Hidden number problem
Given a a prime and a secret integer , the hidden number problem is to find pairs of integers for such that
where are unknown small integers: with a bound on the size of the .
This problem can be solved using the LLL algorithm on:
which will have as a short vector.
Use this python script for a quick implementation of this. If you need to be more precise, use this github repository