Students:
Lecturer: Nguyễn Ngọc Tự
In the ever-evolving landscape of technology, the government agency recognizes the imperative to fortify its communication infrastructure against the looming threat of quantum advancements. As quantum computers inch closer to reality, the conventional cryptographic protocols currently safeguarding sensitive governmental information become susceptible to rapid decryption. In response to this imminent challenge, the agency contemplates the adoption of lattice-based cryptographic algorithms for post-quantum secure communications.
Lattice-based cryptography offers a unique and promising solution tailored to the agency's security needs. The inherent resilience of lattice-based algorithms to quantum attacks aligns seamlessly with the agency's mandate to ensure the confidentiality and integrity of classified information, even in the face of quantum computational capabilities. In this project, we will talk about lattice - introduction, lattice reduction algorithms and lattice problems. We will also discuss about Learning With Error (LWE) problems and cryptosystems using it
A lattice [1] is a set of points in
The vectors
of the lattice. A basis can be represented by the matrix
The most well known computational problems on lattices are the following:
We will give an introduction of LWE:
Definition: Let
We have two computational problems in LWE:
Decision LWE: The problem of deciding whether pairs
Search LWE: The problem of recovering
In this project, we will implicitly assume that
The hardness of LWE problems are the same as SVP and CVP
We will focus on the LWE-based public key cryptosystem:
Parameter: We let
Private Key: Choose
Public Key: For
Encryption: In order to encrypt a bit we choose a random set
Decryption: The decryption of a pair
C/C++, Python 3.x
Number Theory Library (NTL): NTL is a C++ library for doing number theory. NTL supports arbitrary length integer and arbitrary precision floating point arithmetic, finite fields, vectors, matrices, polynomials, lattice basis reduction and basic linear algebra. NTL is free software released under the GNU Lesser General Public License v2.1.
Sagemath: SageMath is a computer algebra system with features covering many aspects of mathematics, including algebra, combinatorics, graph theory, group theory, differentiable manifolds, numerical analysis, number theory, calculus and statistics. Stein realized when designing Sage that there were many open-source mathematics software packages already written in different languages, namely C, C++, Common Lisp, Fortran and Python.
Numpy: NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
We will focus on LWE cryptosystem [2]. When the parameters didn't verify condition at Key Generation and Collection part, this cryptosystem is vulnerable.
This is an attack due to Arora and Ge [3]. The basic idea is to view a LWE sample
where
of degree
When
We get a reasonable chance that all equations have error bounded by
On the other hand, we need
This is an attack originally due to Blum, Kalai and Wasserman[4]. A similar version was later discovered by Wagner[5].
The basic idea is to find small-weight linear combinations
which, give many copies and averaging, gives us
The BKW algorithm – when applied to Search-LWE – can be viewed as consisting of three stages somewhat analogous to those of linear system solving:
This is an attack that follows using the LLL algorithm[6] and (building on LLL) the BKZ algorithm[7] that find approximately short vectors in integer lattices.
The attack use the fact that LWE is, at its core, a problem of finding short vectors in integer lattices. Taking
Now, the vector
The primal attack[8] is a kind of classical and useful attack model for the search-LWE problem and it only requires polynomial LWE samples. The core idea is that transforming the search-LWE instance into a unique-SVP and solving the unique shortest vector by lattice reduction with appropriate root-Hermite factor
Given an LWE instance
(1). The Kannan's embedding[9] reduces the BDD problem to SVP. The corresponding embedding lattice is
and in practice it is preferable to use
(2). The dual embedding proposed by Bai and Galbraith [10] constructs a lattice related to both secret
which has a basis
The vector
(3). The Bai-Galbraith embedding improves dual embedding for such LWE instance that secret and error are chosen from different distributions, its core idea is to balance the size of the error and the secret. Specially, the short vector in lattice
Algorithm | (Some) Broken Parameter setting |
---|---|
Arora-Ge | |
Blum-Kalai-Wasserman | |
Lattice Reduction | |
Primal Attack |
Tool and resources | Description |
---|---|
lwe-estimator | Estimating the concrete security of Learning with Errors instances |
Python 3.x | Use to solve some CTF challenges related to LWE, using some techniques below |
BKW-Algorithm | An implementation of the Blum-Kalai-Wasserman algorithm for solving the Learning with Errors problem. |
All scripts can be found at here
Lattice-based cryptography is regarded as the rival to a quantum computer attack and the future of post-quantum cryptography. So, cryptographic protocols based on lattices have a variety of benefits, such as security, efficiency, lower energy consumption, and speed
We will see that if the parameters are chosen carefully, there won't be any strategy can attack on LWE, so it is widely used in cryptography to create secure encryption algorithms.
Some selected schemes for the purpose of key exchange, based on LWE problem:
[1]. Wikipedia
[2]. https://people.csail.mit.edu/vinodv/CS294/lecture2.pdf
[3]. S. Arora and R. Ge. New algorithms for learning in presence of errors. In L. Aceto, M. Henzinger, and J. Sgall, editors, ICALP, volume 6755 of Lecture Notes in Computer Science, pages
403–415. Springer Verlag, 2011.
[4]. Avrim Blum, Adam Kalai, and Hal Wasserman. Noise-tolerant learning, the parity problem, and the statistical query model. J. ACM, 50(4):506–519, 2003.
[5]. Wagner, D. (2002). A Generalized Birthday Problem. In: Yung, M. (eds) Advances in Cryptology — CRYPTO 2002. CRYPTO 2002. Lecture Notes in Computer Science, vol 2442. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45708-9_19
[6]. Lenstra, A. K.; Lenstra, H. W. Jr.; Lovász, L. (1982). "Factoring polynomials with rational coefficients". Mathematische Annalen. 261 (4): 515–534. CiteSeerX 10.1.1.310.318.
[7]. C.P. Schnorr, A hierarchy of polynomial time lattice basis reduction algorithms, Theoretical Computer Science,Volume 53, Issues 2–3,1987, Pages 201-224,ISSN 0304-3975, https://doi.org/10.1016/0304-3975(87)90064-8.
[8]. Xue Zhang; Zhongxiang Zheng; Xiaoyun Wang; (2021). A detailed analysis of primal attack and its variants . Science China Information Sciences, (), –. doi:10.1007/s11432-020-2958-9
[9]. Kannan R. Minkowski’s convex body theorem and integer programming. Math Oper Res, 1987, 12: 415–440
[10]. Bai S, Galbraith S D. Lattice decoding attacks on binary LWE. In: Proceedings of Australasian Conference on Information Security and Privacy, 2014. 322–337
[11]. MATZOV. (2022). Report on the Security of LWE: Improved Dual Lattice Attack. Zenodo. https://doi.org/10.5281/zenodo.6493704
[12]. Albrecht, M.R. On Dual Lattice Attacks Against Small-Secret LWE and Parameter Choices in HElib and SEAL. In Advances inCryptology—EUROCRYPT 2017; Springer International Publishing: Berlin/Heidelberg, Germany, 2017; pp. 103–129
[13]. https://pq-crystals.org/
[14]. https://csrc.nist.gov/Projects/post-quantum-cryptography/selected-algorithms-2022
[15]. https://frodokem.org/
[16]. https://csrc.nist.gov/events/2019/second-pqc-standardization-conference
[17]. https://newhopecrypto.org/index.shtml
[18]. Martin R. Albrecht, Rachel Player and Sam Scott. On the concrete hardness of Learning with Errors. Journal of Mathematical Cryptology. Volume 9, Issue 3, Pages 169–203, ISSN (Online) 1862-2984, ISSN (Print) 1862-2976 DOI: 10.1515/jmc-2015-0016, October 2015
[19]. https://www.maths.ox.ac.uk/system/files/attachments/lattice-reduction-and-attacks.pdf