Parameter Selection in Lattice-Based Cryptography
Total Page:16
File Type:pdf, Size:1020Kb
Parameter selection in lattice-based cryptography Rachel Player Thesis submitted to the University of London for the degree of Doctor of Philosophy Information Security Group Royal Holloway, University of London 2017 Declaration These doctoral studies were conducted under the supervision of Prof. Carlos Cid and Prof. Sean Murphy. The work presented in this thesis is the result of original research carried out by myself, in collaboration with others, whilst enrolled in the Department of Information Security as a candidate for the degree of Doctor of Philosophy. This work has not been submitted for any other degree or award in any other university or educational establishment. Rachel Player 2 November 2017 2 Abstract Public-key cryptography in use today is based on classically hard problems such as factoring or solving discrete logarithms. These problems could be efficiently solved if an adversary had access to a sufficiently large quantum computer. The potential of such a quantum computer therefore represents a threat on current cryptography. The field of post-quantum cryptography aims to mitigate against this threat by proposing schemes based on alternative assumptions that are believed to be hard in both the classical and quantum setting. Lattice-based cryptography has emerged as a promising candidate for post-quantum cryptography. One reason for this is the wealth of applications that are possible, perhaps the most notable of which is Fully Homomorphic Encryption (FHE). This enables computations to be performed on encrypted data, without requiring access to the secret key, and for these computations to correspond to operations on the underlying data in a meaningful way. The Learning with Errors (LWE) problem and its variants, such as LWE with small secret, LWE with binary error, and Ring-LWE, are used as hardness assumptions in many lattice-based schemes. In this thesis we consider parameter selection in cryptosystems based on LWE. We begin with a focus on security by considering the concrete hardness of LWE. We comprehensively review the algorithms that can be used to solve LWE and its variants with a small secret. Turning our attention to an LWE variant where the error distribution is binary, we show there is an additional attack applicable in this setting. In applications, the selection of appropriate parameters is often very challenging due to the conflicting requirements of security, correctness and performance. We highlight this in the application setting of FHE by considering a scheme based on Ring-LWE. In particular, we discuss the selection of parameters in SEAL, an implementation of the scheme by Fan and Vercauteren. 3 Contents 1 Introduction 10 1.1 Motivation . 10 1.2 Structure of thesis . 13 1.3 Original work and our individual contributions . 14 2 Notation and background 17 2.1 Notation . 17 2.2 Lattice background . 18 2.3 The Learning with Errors problem . 23 3 Lattice reduction 30 3.1 The LLL algorithm . 32 3.2 The BKZ algorithm . 33 3.2.1 Asymptotic running time of BKZ . 36 3.2.2 Estimating running time of BKZ in practice . 38 3.3 Estimating lattice reduction in this thesis . 40 4 Algorithms for solving LWE 43 4.1 Motivation . 43 4.2 Strategies for solving LWE . 45 4.2.1 Solving LWE via solving the Short Integer Solutions problem 46 4.2.2 Solving LWE via solving Bounded Distance Decoding . 47 4.2.3 Solving LWE via recovering the secret directly . 47 4.3 Exhaustive search for LWE . 48 4.3.1 Meet-in-the-Middle for LWE . 49 4.4 The Arora-Ge algorithm . 52 4.5 The BKW algorithm . 53 4.6 Solving Decision-LWE via lattice reduction . 57 4.6.1 Verifying lattice reduction models . 60 4.7 Algorithms for solving Bounded Distance Decoding . 61 4.8 Solving LWE via unique Shortest Vector Problem . 64 5 Algorithms for solving small variants of LWE 71 5.1 Introduction to LWE with small secrets . 72 5.2 Exhaustive search for small secret LWE . 74 5.3 Small secret variants of the BKW algorithm . 75 5.4 Solving small secret LWE via unique Shortest Vector Problem . 76 5.5 Solving Decision-LWE via lattice reduction for small or sparse secret 77 4 CONTENTS 5.6 Introduction to LWE with binary error . 80 5.6.1 Modelling LWE with binary error as general LWE . 81 5.7 The Meet-in-the-Middle attack for LWE with binary error . 82 5.8 Solving Decision-LWE with binary error via lattice reduction . 85 5.9 Solving LWE with binary error via unique Shortest Vector Problem . 86 5.10 The hybrid attack for LWE with binary error . 87 5.11 Comparison of the hybrid attack with other algorithms for LWE with binary error . 93 6 Ring Learning with Errors 99 6.1 Algebraic background . 100 6.2 The space H ............................... 102 6.3 Discretisation . 104 6.4 Hardness of Ring-LWE . 105 6.5 Error distributions . 107 6.6 The variant of Ducas and Durmus . 109 6.6.1 The case m is an odd prime . 112 7 Homomorphic Encryption 119 7.1 Introduction to FHE . 119 7.1.1 SEAL: Implementing the FV scheme . 121 7.2 Security of Ring-LWE based FHE schemes . 130 7.3 Encoding in Ring-LWE based FHE schemes . 133 7.4 Noise growth in SEAL . 136 7.4.1 Inherent noise growth analysis . 140 7.4.2 Invariant noise growth analysis . 153 7.4.3 Discussion . 162 7.4.4 Heuristic noise growth estimates . 164 7.5 Parameter selection in SEAL . 169 7.5.1 Automatic parameter selection in SEAL . 172 7.6 When to relinearize in SEAL . 172 7.6.1 Effect of relinearization on overall noise growth . 173 7.6.2 Choosing relinearization parameters . 174 Bibliography 176 A SEAL code used in Section 7.6 199 5 List of Tables 3.1 Estimates used in the LWE estimator for the log of the cost in clock cycles log(tk) to solve SVP in dimension k................ 41 4.1 Time complexity for distinguishing Ls,χ from random with advantage 1 ≈ 23 based on lattice reduction estimates from the literature. 60 4.2 Time complexity for distinguishing Ls,χ from random with advantage 1 1 c 2 −c ≈ 23 in the case that q = n and α = n for a constant c based on lattice reduction estimates from the literature. 61 5.1 Comparison of approaches for solving LWE with binary error using at most m = 2n samples. The bit hardness of the hybrid attack, reduction to uSVP and a distinguishing attack are given. 94 5.2 Comparison of attacks on LWE with binary error obtained from the LWE estimator [16, 6]p using m = 2n samples and error distribution characterised by α = 2π=2q....................... 98 5.3 Comparison of attacks on LWE with binary error obtained from the LWE estimator [16,p 6] using m = 2n samples, error distribution char- acterised by α = 2π=2q, and ternary secret with h = n=2...... 98 7.1 Parameters in SEAL. 123 7.2 Default pairs (n; q) in SEAL v2.2 and estimated log of cost of attacks according to commit f13c4a7 of the LWE estimator called with small secret and m = 2n samples. 132 7.3 Summary of bounds for the growth of invariant and inherent noise in ciphertexts after various homomorphic operations in SEAL. 163 7.4 Default pairs (n; q) in SEAL v2.2 and an upper bound of their es- timated security, expressed as a log of the estimated cost of the the best attack according to commit f13c4a7 of the LWE estimator. (See also Table 7.2.) . 170 6 List of Figures 5.1 Estimates of solving LWE with binary error instances with m = 2n samples and modulus q = 256 using the hybrid attack and the best other algorithm. 97 6.1 [95, Figure 1]. Mappings between different spaces. 110 6.2 Mappings between spaces for m an odd prime. 113 7 Publications Parts of this thesis are based on the following works. • Martin R. Albrecht, Rachel Player and Sam Scott. On the concrete hardness of Learning with Errors. Journal of Mathematical Cryptology, 9(3):169–203, 2015. • Johannes Buchmann, Florian Göpfert, Rachel Player and Thomas Wunderer. On the Hardness of LWE with Binary Error: Revisiting the Hybrid Lattice- Reduction and Meet-in-the-Middle Attack. In D. Pointcheval, A. Nitaj, and T. Rachidi, editors, AFRICACRYPT 2016, volume 9646 of Lecture Notes in Computer Science, pages 24–43. Springer, 2016. • Hao Chen, Kim Laine and Rachel Player. Simple Encrypted Arithmetic Li- brary - SEAL. In M. Brenner and K. Rohloff, editors, WAHC’17 - 5th Workshop on Encrypted Computing and Applied Homomorphic Cryptography, to appear. • Sean Murphy and Rachel Player. Noise Distributions in Homomorphic Ring- LWE. In submission. • Kim Laine and Rachel Player. Simple Encrypted Arithmetic Library - SEAL (v2.0). Technical report, September 2016. • Hao Chen, Kim Laine and Rachel Player. Simple Encrypted Arithmetic Li- brary - SEAL (v2.1). Technical report, September 2016. • Hao Chen, Kim Laine and Rachel Player. Simple Encrypted Arithmetic Li- brary - SEAL (v2.2). Technical report, June 2017. The following work was also undertaken during the these doctoral studies. • Hao Chen, Kim Laine, Rachel Player and Yuhou Xia. High-Precision Arith- metic in Homomorphic Encryption. In submission. 8 Acknowledgements As I was warned, writing this page has been the hardest part. All of this would have been impossible without the guidance of my supervisors Carlos Cid and Sean Murphy, and the financial aid of an ACE-CSR PhD grant, which I gratefully acknowledge. Carlos, thank you for allowing me the freedom to follow my interests, and of course, the trip to Japan! Sean, thank you for your patience with both my naive questions about statistics and the many emails of my unfiltered thinking out loud.