Abstract
We initiate the study of partial key exposure in Ring-LWE (RLWE)-based cryptosystems. Specifically, we (1) Introduce the search and decision Leaky R-LWE assumptions (Leaky R-SLWE, Leaky R-DLWE), to formalize the hardness of search/decision RLWE under leakage of some fraction of coordinates of the NTT transform of the RLWE secret. (2) Present and implement an efficient key exposure attack that, given certain 1/4-fraction of the coordinates of the NTT transform of the RLWE secret, along with samples from the RLWE distribution, recovers the full RLWE secret for standard parameter settings. (3) Present a search-to-decision reduction for Leaky R-LWE for certain types of key exposure. (4) Propose applications to the security analysis of RLWE-based cryptosystems under partial key exposure.
1 Introduction
There has been a monumental effort in the cryptographic community to develop “post-quantum” cryptosys-tems that remain secure even in the presence of a quantum adversary. One of the foremost avenues for viable post-quantum public key cryptography is to construct schemes from the Ring-Learning with Error (RLWE) assumption—currently 3 out of 26 of the second round NIST submissions are based on assumptions in the ring setting. RLWE is often preferred in practice over standard LWE due to its algebraic structure, which allows for smaller public keys and more efficient implementations. In the RLWE setting, we typically consider rings of the form
The NTT transform.
One key method for speeding up computations in the RLWE setting is usage of the NTT transform (similar to the discrete Fourier transform (DFT), but over finite fields) to allow for faster polynomial multiplication over the ring Rq. Specifically, applying the NTT transform to two polynomials
This work.
The goal of this work is to initiate a study of partial key exposure in RLWE based cryptosystems and explore both positive and negative results in this setting. Specifically, we (1) define search and decision versions of Leaky RLWE assumptions, where the structured leakage occurs on the coordinates of the NTT transform of the RLWE secret; (2) present partial key exposure attacks on RLWE, given 1 /4-fraction of structured leakage on the secret key; (3) present a search to decision reduction for the Leaky RLWE assumptions; and (4) propose applications of the decision version of the assumption to practical RLWE-based cryptosystems.
1.1 Leaky RLWE Assumptions–Search and Decision Versions
We next briefly introduce the search and decision versions of the Leaky RLWE assumptions. For
The search version of the RLWE problem with leakage, denoted Leaky R-SLWE, is parametrized by
The decision version of the RLWE problem with leakage, denoted Leaky R-DLWE is parametrized by
When
1.2 Our Results
Partial key exposure attacks.
We present attacks on Leaky R-SLWE and test them on various practical parameter settings, such as the NewHope [7] parameter settings as well as the RLWE challenges of Crockett and Peikert [12]. Our attacks demonstrate that Leaky R-SLWE is easy for leakage parameters
A search-to-decision reduction.
Define
Theorem 1.1
(Informal). Assume
(1)
(2)
(3)
While at first glance it may seem that the conclusions (1), (2), (3) are redundant, in fact they are incomparable; Indeed, conclusion (1) does not imply (2) (resp. (3)), since the adversary in (2) (resp. (3)) is given additional leakage. Conversely, conclusion (2) (resp. (3)) does not imply (1), since the set of NTT coordinates that are indistinguishable from random is smaller in (2).
Note that our experimental results show that for our chosen parameter settings s
Applications.
The Leaky R-DLWE assumption is a useful tool for analyzing the security of RLWE-based cryptosystems subject to partial key exposure, and guaranteeing a graceful degradation in security. In particular, the Leaky R-DLWE assumption was used to analyze the NewHope protocol of [7] in the ePrint version of this paper [14]. The assumption is applicable to schemes in which the RLWE assumption is used to guarantee that a certain outcome is high-entropy (as opposed to uniform random), such as NewHope without reconciliation [6].
Practicality of our attack.
We note that an attack on Leaky R-SLWE yields an attack on standard search R-LWE by guessing each possible leakage outcome, running the Leaky R-SLWE attack and checking correctness of the recovered secret. Therefore, we believe this line of research is interesting beyond the context of leakage resilience, since if the attack can be made to work successfully for sufficiently low leakage rate (far lower than the 1 /4-leakage rate of our attacks), then one could potentially obtain an improved attack on standard search R-LWE.
We chose to consider partial exposure of the NTT transform of the R- LWEsecret, since in practical schemes the secret key is often stored in the NTT domain and certain types of side-channel attacks allow recovering large portions of the secret key stored in memory. E.g., in their analysis of “cold boot attacks” on NTT cryp-tosystems, Albrecht et al. [4] considered bit-flip rates as low as 0.2%. However, the highly structured leakage required for our attack is unlikely to occur in a practical leakage setting such as a “cold boot attack,” where one expects to recover the values of random locations in memory. We leave open the question of reducing the structure of the leakage in our attack. Specifically, as a starting point it will be interesting to see if our attack can extend to leakage patterns of n′ = 16, |S| = 4 or n′ = 32, |S| = 8, etc. While the leakage rate remains the same (1/4) in each case, these patterns capture leakage that is less and less structured, since at the extreme, one can view leakage of a random 1 /4-fraction of the NTT coordinates as an instance of Leaky R-SLWE with parameters n′ = n and |S| = n/4. [3]
1.3 Comparison with Concurrent Work of Bolboceanu et al. [9]
One of the settings considered by [9] is sampling the RLWE secret from an ideal I ⊆ qR. It is straightforward to see that sampling the RLWE secret uniformly at random from Rq and then leaking the NTT coordinates i such that i = α mod 2n′ is equivalent to sampling the RLWE secret from the ideal I that contains those elements whose NTT transform is 0 in positions i such that i = α mod 2n′.
Nevertheless, our decisional assumption is weaker than the assumption of [9], since [9] require that the entire vector u be indistinguishable from uniform random, whereas we only require that the NTT transform of u is indistinguishable from uniform random at the positions i that are not leaked. Our assumption lends itself to a search-to-decision reduction while the assumption of [9] does not. While [9] do provide a direct security reduction for their decisional assumption, the required standard deviation of the error (in polynomial basis, tweaked and scaled by q) is ,
Finally, we compare our attack to that of [9]. For fixed n, q, our attack works for noise regimes that are not covered by the attack of [9]. For example, for NewHope settings of n = 1024, q = 12289, the attack of [9] has success rate at most 1/1000 when the standard deviation of noise distribution is less than 0.00562. [4] In contrast, our attack works (with success ranging from 82/200 to 2/1000) when the standard deviation of the noise is
1.4 Related Work
Leakage-resilient cryptography.
The study of provably secure, leakage-resilient cryptography was introduced by the work of Dziembowski and Pietrzak in [19]. Pietrzak [29] also constructed a leakage-resilient stream-cipher. Brakerski et al. [11] showed how to construct a scheme secure against an attacker who leaks at each time period. There are other works as well considering continual leakage [17, 22]. There are also work on leakage-resilient signature scheme [10, 21, 27].
Leakage-resilience and Lattice-based Cryptography.
Goldwasser et al. [20], and subsequently [2, 16, 18] studied the leakage resilience of standard LWE based cryptosystems in the symmetric and public key settings.
Leakage Resilience of Ring-LWE.
Dachman-Soled et al. [13] considered the leakage resilience of a RLWE-based public key encryption scheme for specific leakage profiles. This was followed by Albrecht et al. [4], they investigated cold boot attacks and compared the number of operations for implementing the attack when the secret key is stored as polynomial coefficients versus when encoding of the secret key using a number theoretic transform (NTT) is stored in memory. Recently, [30] showed that given multiple samples of RLWE instances such that the public key for every instance lies in some specific subring, one can reduce the original RLWE problem to multiple independent RLWE problems over the subring. In this work we do not place any such restriction on the RLWE samples required to mount partial key exposure attack.
2 Preliminaries
For a positive integer n, we denote by [n] the set {0, . . . , n − 1}. We denote vectors in boldface and matrices using capital letters A. For vector x over ℝn or ℂn, define the ℓ2 norm as
We present the background and standard definitions related to lattices, algebraic number theory, RLWE, and NTT transform in Appendix A.
3 Partial Key Exposure Attack on Ring-LWE
3.1 Reconstructing the secret given (α mod 8) leakage
Recall that for
We consider attacks in which the adversary learns all coordinates i of
For
The coefficients of e can be partitioned into u groups of size n′, forming independent linear systems, each with n′ variables and one equation. Given only the leakage, the set of feasible secret keys is a cartesian product
Since each coordinate of e is drawn independently from χ and since each linear system above has small dimension n′, we can use a brute-force-search to find the most likely solution and calculate its probability.
Given this information, we will carefully choose the solutions ej
In order to ensure that (2) holds, we only keep the guess jfor
Since computing the exact probability as above is computationally intensive, we develop a heuristic that performs nearly as well and is much faster. Note that finding the “most likely” solution is equivalent to solving a CVP problem over an appropriate n′-dimensional lattice. We then calculate the probability of the solution under the discrete Gaussian and set some threshold . If the probability of the solution is above the threshold we keep it, if not we discard it. Experimentally, we show that by setting the threshold correctly, we can still achieve high confidence. See Figure 1 for the exact settings of the threshold for each setting of parameters. Our experiments also show that (1) also holds given a reasonable number of RLWE samples. See Section 3.2 for a presentation of our experimental results. We describe our attack in cases where the leakage is on all coordinates i such that
Complexity of the attack.
We provide the pseudocode for the attack in Appendix D, Figure 3. While our attack works well in practice, we do not provide a formal proof that our attack is polynomial time for a given setting of parameters. Within the loop beginning on line 5, all the steps (or subroutines) shown in Figure 3 can be computed in polynomial time. Note that even step 12 (CVP.closest_vector), which requires solving a CVP instance, can be computed in polynomial time because for the leakage patterns we consider, the dimension of the CVP instance will always be either 4 or 8–a constant, independent of n. However, our analysis does not bound the number of iterations of the loop beginning on line 5. Specifically,we do not analyze how large the variable RLWESamples must be set in order to guarantee that the attack is successful with high probability. Bounding this variable corresponds to bounding the number of RLWE samples needed in order to obtain a sufficient number of “high confidence” solutions. In practice, the number of RLWE samples was always fewer than 200 for all parameter settings. In future work,we plan to compute the expected number of RLWE samples needed to obtain a sufficient number of high confidence solutions for a given parameter setting. Assuming this expected number of samples is polynomial in n, we obtain an expected polynomial time attack.
3.2 Experimental Results
We first assess the performance of our attack on the RLWE challenges published by Crockett and Peikert [12], with various parameters, ranging from “toy” to “very hard” security levels. For each parameter setting, a cut-and-choose protocol was used by [12] to prove correctness of the challenges: They committed to some number (e.g. N = 32) of independent RLWE instances, a random index i was chosen, and the secret key for all except the i-th instance was revealed. For each of the 31 opened challenges,we simulate the Leaky RLWE experiment and attempt to recover the full secret s using our attack. We next measure the performance of our attack on RLWE instances generated using the dimension, modulus and noise distribution proposed in the original NewHope scheme [7]. These parameters are more conservative than the ones chosen for the later submission to the NIST competition [5]. When multiple RLWE samples are released, bounded error distributions are less secure [3]. We therefore tested our attack in the more difficult setting of Gaussian error, in addition to the original binomial error distribution of [7].
The experiments were run using server with AMD Opteron 6274 processor, with a python script using all the cores with Sage version 8.1.We used fplll [15] library for CVP solver and the source code of all the attacks are available online at [1]. The results of our attacks are summarized in Figure 1.We report the total number of instances we broke and the average number of RLWE samples needed for those instances. To decide whether a solution is kept or discarded, its probability mass under the error distribution χ is calculated and compared to the threshold. The threshold for each parameter setting is set heuristically so that minimal weight solutions passing the threshold are correct with high confidence (see Figure 1 for the exact threshold settings). We tested leakage patterns of
4 Search and Decisional Ring-LWE with Leakage
Definition 4.1
(Search RLWE (R-SLWE) with Leakage) The search version of the R-LWE problem with leakage, denoted Leaky
Definition 4.2
(Decision RLWE (R-DLWE) with Leakage) The decision version of the R-LWE problem with leakage, denoted Leaky
chosen uniformly random, otherwise.
5 Search to Decision Reduction With Leakage
Let the RLWE secret be denoted by
Theorem 5.1
(Existence of Basic Attack). If, for any
Our attack Attack 1 uses the Basic Attack to learn all the values
For i,
Definition 5.2
A probability distribution
We remark that RLWE error distribution χ is automorphically closed [23].
We formally define Attack 1 in Figure 3 .We next sketch how Attack 1 can be used to complete the proof. For dimenstion n and parameter
Assume subexponential
Now, if given
For n* > 4, the only cases in which Attack 1 does not recover
Theorem 5.3
Assume
–
–
–
where,
Proof. We assume WLOG that α = 1. Assume
Case 1: b is such that
By properties of the group
Case 2: b = n * − 1. In this case, with appropriate setting of poly(n), we can use Attack 1 to recover the positions i such that
Case 2(a):
Specifically, given the initial leakage
Case 2(b): b′ = 2n* − 1. Due to essentially the same argument as before, with appropriate setting of poly(n), we can (w.h.p.) recover the positions i such that i ≡ 2n* − 1 mod 2n* in time
Case 3: b = 2n* − 1. This essentially follows identically to Case 2. □
Acknowledgement
This work is supported in part by NSF grants #CNS-1840893, #CNS-1453045 (CAREER), by a research partnership award from Cisco and by financial assistance award 70NANB15H328 from the U.S. Department of Commerce, National Institute of Standards and Technology.
References
[1] Source Code 2019, https://github.com/mathcrypt/RLWESearch in Google Scholar
[2] Adi Akavia, Shafi Goldwasser and Vinod Vaikuntanathan, Simultaneous Hardcore Bits and Cryptography against Memory Attacks, in: TCC 2009 (Omer Reingold, ed.), LNCS 5444, pp. 474–495, Springer, Heidelberg, March 2009.10.1007/978-3-642-00457-5_28Search in Google Scholar
[3] Martin Albrecht, Carlos Cid, Jean-Charles Faugere, Robert Fitzpatrick and Ludovic Perret, Algebraic algorithms for LWE problems, (2014).10.1145/2815111.2815158Search in Google Scholar
[4] Martin R. Albrecht, Amit Deo and Kenneth G. Paterson, Cold Boot Attacks on Ring and Module LWE Keys Under the NTT, IACR TCHES 2018 (2018), 173–213, https://tches.iacr.org/index.php/TCHES/article/view/727310.46586/tches.v2018.i3.173-213Search in Google Scholar
[5] Erdem Alkim, Roberto Avanzi, Joppe Bos, Léo Ducas, Antonio de la Piedra, Thomas Pöppelmann, Peter Schwabe and Douglas Stebila, Newhope: Algorithm specification and supporting documentation. Submission to the NIST Post-Quantum Cryptography Standardization Project, 2017Search in Google Scholar
[6] Erdem Alkim, Léo Ducas, Thomas Pöppelmann and Peter Schwabe, NewHope without reconciliation Cryptology ePrint Archive, Report 2016/1157, 2016, http://eprint.iacr.org/2016/1157Search in Google Scholar
[7] Erdem Alkim, Léo Ducas, Thomas Pöppelmann and Peter Schwabe, Post-quantum Key Exchange - A New Hope, in: USENIX Security 2016 (Thorsten Holz and Stefan Savage, eds.), pp. 327–343, USENIX Association, August 2016.Search in Google Scholar
[8] Jacob Alperin-Sheriff and Chris Peikert, Practical Bootstrapping in Quasilinear Time, in: CRYPTO 2013, Part I (Ran Canetti and Juan A. Garay, eds.), LNCS 8042, pp. 1–20, Springer, Heidelberg, August 2013.10.1007/978-3-642-40041-4_1Search in Google Scholar
[9] Madalina Bolboceanu, Zvika Brakerski, Renen Perlman and Devika Sharma, Order-LWE and the Hardness of Ring-LWE with Entropic Secrets Cryptology ePrint Archive, Report 2018/494, 2018, https://eprint.iacr.org/2018/494Search in Google Scholar
[10] Elette Boyle, Gil Segev and Daniel Wichs, Fully Leakage-Resilient Signatures, Journal of Cryptology 26 (2013), 513–558.10.1007/s00145-012-9136-3Search in Google Scholar
[11] Zvika Brakerski, Yael Tauman Kalai, Jonathan Katz and Vinod Vaikuntanathan, Overcoming the Hole in the Bucket: Public-Key Cryptography Resilient to Continual Memory Leakage, in: 51st FOCS pp. 501–510, IEEE Computer Society Press, October 2010.10.1109/FOCS.2010.55Search in Google Scholar
[12] Eric Crockett and Chris Peikert, Challenges for Ring-LWE., IACR Cryptology ePrint Archive 2016 (2016), 782.Search in Google Scholar
[13] Dana Dachman-Soled, Huijing Gong, Mukul Kulkarni and Aria Shahverdi, On the Leakage Resilience of Ideal-Lattice Based Public Key Encryption Cryptology ePrint Archive, Report 2017/1127, 2017, https://eprint.iacr.org/2017/1127Search in Google Scholar
[14] Dana Dachman-Soled, Huijing Gong,Mukul Kulkarni and Aria Shahverdi, Partial Key Exposure in Ring-LWE-Based Cryptosys-tems: Attacks and Resilience Cryptology ePrint Archive, Report 2018/1068, 2018, https://eprint.iacr.org/2018/1068Search in Google Scholar
[15] The FPLLL development team, fplll, a lattice reduction library Available at https://github.com/fplll/fplll 2016.Search in Google Scholar
[16] Yevgeniy Dodis, Shafi Goldwasser, Yael Tauman Kalai, Chris Peikert and Vinod Vaikuntanathan, Public-Key Encryption Schemes with Auxiliary Inputs, in: TCC 2010 (Daniele Micciancio, ed.), LNCS 5978, pp. 361–381, Springer, Heidelberg, February 2010.10.1007/978-3-642-11799-2_22Search in Google Scholar
[17] Yevgeniy Dodis, Kristiyan Haralambiev, Adriana López-Alt and Daniel Wichs, Cryptography against Continuous Memory Attacks, in: 51st FOCS pp. 511–520, IEEE Computer Society Press, October 2010.10.1109/FOCS.2010.56Search in Google Scholar
[18] Yevgeniy Dodis, Yael Tauman Kalai and Shachar Lovett, On cryptography with auxiliary input, in: 41st ACM STOC (Michael Mitzenmacher, ed.), pp. 621–630, ACM Press, May / June 2009.10.1145/1536414.1536498Search in Google Scholar
[19] Stefan Dziembowski and Krzysztof Pietrzak, Leakage-Resilient Cryptography, in: 49th FOCS pp. 293–302, IEEE Computer Society Press, October 2008.10.1109/FOCS.2008.56Search in Google Scholar
[20] Shafi Goldwasser, Yael Tauman Kalai, Chris Peikert and Vinod Vaikuntanathan, Robustness of the Learning with Errors Assumption, in: ICS 2010 (Andrew Chi-Chih Yao, ed.), pp. 230–240, Tsinghua University Press, January 2010.Search in Google Scholar
[21] Jonathan Katz and Vinod Vaikuntanathan, Signature Schemes with Bounded Leakage Resilience, in: ASIACRYPT 2009 (Mit-suru Matsui, ed.), LNCS 5912, pp. 703–720, Springer, Heidelberg, December 2009.10.1007/978-3-642-10366-7_41Search in Google Scholar
[22] Allison B. Lewko, Mark Lewko and Brent Waters, How to leak on key updates, in: 43rd ACM STOC (Lance Fortnow and Salil P. Vadhan, eds.), pp. 725–734, ACM Press, June 2011.10.1145/1993636.1993732Search in Google Scholar
[23] Vadim Lyubashevsky, Search to decision reduction for the learning with errors over rings problem, in: 2011 IEEE Information Theory Workshop, ITW 2011, Paraty, Brazil, October 16-20, 2011 pp. 410–414, 2011.10.1109/ITW.2011.6089491Search in Google Scholar
[24] Vadim Lyubashevsky, Chris Peikert and Oded Regev, On Ideal Lattices and Learning with Errors over Rings, in: EURO-CRYPT 2010 (Henri Gilbert, ed.), LNCS 6110, pp. 1–23, Springer, Heidelberg, May / June 2010.10.1007/978-3-642-13190-5_1Search in Google Scholar
[25] Vadim Lyubashevsky, Chris Peikert and Oded Regev, On Ideal Lattices and Learning with Errors over Rings, J. ACM 60 (2013), 43:1–43:35.10.1145/2535925Search in Google Scholar
[26] Vadim Lyubashevsky, Chris Peikert and Oded Regev, A Toolkit for Ring-LWE Cryptography Cryptology ePrint Archive, Report 2013/293, 2013, http://eprint.iacr.org/2013/29310.1007/978-3-642-38348-9_3Search in Google Scholar
[27] Tal Malkin, Isamu Teranishi, Yevgeniy Vahlis and Moti Yung, Signatures Resilient to Continual Leakage on Memory and Computation, in: TCC 2011 (Yuval Ishai, ed.), LNCS 6597, pp. 89–106, Springer, Heidelberg, March 2011.10.1007/978-3-642-19571-6_7Search in Google Scholar
[28] Chris Peikert, How(Not) to Instantiate Ring-LWE, in: SCN 16 (Vassilis Zikas and Roberto De Prisco, eds.), LNCS 9841, pp. 411–430, Springer, Heidelberg, August / September 2016.10.1007/978-3-319-44618-9_22Search in Google Scholar
[29] Krzysztof Pietrzak, A Leakage-Resilient Mode of Operation, in: EUROCRYPT 2009 (Antoine Joux, ed.), LNCS 5479, pp. 462–482, Springer, Heidelberg, April 2009.10.1007/978-3-642-01001-9_27Search in Google Scholar
[30] Katherine E. Stange, Algebraic aspects of solving Ring-LWE, including ring-based improvements in the Blum-Kalai-Wasserman algorithm Cryptology ePrint Archive, Report 2019/183, 2019, https://eprint.iacr.org/2019/183Search in Google Scholar
A Additional Preliminaries
A 1 Algebraic Number Theory
For a positive integer m, the mth cyclotomic number field is a field extension
Ring of Integers R and Its Dual R∨
Let R ⊂ K denote the set of all algebraic integers in number field K defined above. This set forms a ring (under the usual addition and multiplication operations in K), called the ring of integers of K.
An (integral) ideal
Definition A.1
For
The dual ideal R∨ of R is defined as
A 2 Ring-LWE
We next present the formal definition of the RLWE problem as given in [26].
Definition A.2
(RLWE Distribution) For a “secret"
Definition A.3
(RLWE, Average-Case Decision) The average-case decision version of the RLWE problem, denoted R-DLWEq,χ, is to distinguish with non-negligible advantage between independent samples from As,χ, where
Theorem A.4
[26, Theorem 2.22] Let K be the mth cyclotomic number field having dimension
A Note on the Tweak.
In [8], Alperin-Sheriff and Peikert show that an equivalent “tweaked" form of the Ring-LWE problem can be used in cryptographic applications without loss in security or efficiency. This is convenient since the “tweaked" version does not involve R∨. The “tweaked" ring-LWE problem can be obtained by implicitly multiplying the noisy products b by the “tweak" factor t, and, as it is explained in [8],
where
A 3 Number Theoretic Transform (NTT)
Let
where the NTT coefficients
The function NTT−1 is the inverse of function NTT, defined as
where the NTT inverse coefficients pi are defined as:
B Attack Algorithm for Other Leakage Patterns
B.1 Reconstructing the secret given (α1, α2 mod n′) leakage
Let
Similar to the previous attack, we obtain the following constraints on the error, given leakage on the secret key and an RLWE sample,
We solve a corresponding CVP instance to find the “most likely” solution,
Similar to our previous attack, our goal is to carefully choose the answers with “high confidence” such that (1) In total, we must guess at least u number of n′-dimensional solutions,
Our experiments in section 3.2 again show that we can obtain enough “high” confidence solutions, without requiring too large a number of RLWE instances.
C Description of Basic Attack
In this section, we present the Basic Attack, following the description from [23, 24, 25] and using the fact that NTT coefficients form a CRT representation. We first recall definition of CRT representation in our setting of parameters.
Definition C.1
(CRT Representation) For p ∈ Rq, and ω a mth primitive root of unity in
for
It is easy to see that
We first introduce the following definition:
Definition C.2
(Hybrid Leaky RLWE Distribution) For
Define
We now show the distinguisher 𝒟j can be used to construct an algorithm that finds the value of
Next we present the samples construction algorithm that takes a guess g ∈ ℤq and transform
where
Observe that if g is the correct guess, then
D Pseudocode of Attack from Section 3
© 2020 D. Dachman-Soled et al., published by De Gruyter
This work is licensed under the Creative Commons Attribution 4.0 International License.