Presentation is loading. Please wait.

Presentation is loading. Please wait.

Background: Lattices and the Learning-with-Errors problem

Similar presentations


Presentation on theme: "Background: Lattices and the Learning-with-Errors problem"β€” Presentation transcript:

1 Background: Lattices and the Learning-with-Errors problem
China Summer School on Lattices and Cryptography, June 2014

2 Starting Point: Linear Equations
Easy to solve a linear system of equations Given A, b, find s Solved using Gaussian elimination, Cramer rule, etc. [Regev 2005] Hard if we add a little noise 𝒆 is a noise vector, |𝒆|β‰ͺπ‘ž Given A, b, find s and/or e A s = b (π‘šπ‘œπ‘‘ π‘ž) + A s b (π‘šπ‘œπ‘‘ π‘ž) e =

3 Learning with Errors (LWE) [R’05]
Parameters: q (modulus), n (dimension), m>n (# of samples) Secret: uniformly random vector π’”βˆˆ 𝑍 π‘ž 𝑛 Input: random matrix π‘¨βˆˆ 𝑍 π‘ž π‘šΓ—π‘› , vector π’ƒβˆˆ 𝑍 π‘ž π‘š Computed as 𝒆 chosen from some distribution s.t. |𝒆|β‰ͺπ‘ž whp 𝒃 is close to the columns space of 𝑨 Goal: discover 𝒔 + A s (π‘šπ‘œπ‘‘ π‘ž) e = b Γ—

4 Learning with Errors (LWE) [R’05]
Is it really hard to solve LWE? How hard? For what range of parameters? Is it useful? Can we design cryptosystems with security based on the hardness of LWE We’ll do #2 first, then #1

5 Using LWE in Cryptography

6 The Decision-LWE Problem
A more useful variant of LWE: Same parameters q, n, m Input: same and A is still a uniform random matrix in 𝑍 π‘ž π‘šΓ—π‘› Either 𝒃=𝑨×𝒔+𝒆 (π‘šπ‘œπ‘‘ π‘ž), or 𝒃 is uniform in 𝑍 π‘ž π‘šΓ—π‘› Goal: distinguish 𝑨×𝒔+𝒆 from uniform I.e., given A,b, decide if b is β€œunusually close” to the column space of A A b

7 Search vs. Decision LWE Clearly, if we can solve the search problem then we can also solve the decision problem Try to solve the search problem on A,b If successful then b is close to the column space of A, otherwise b is random More interesting: If we can solve decision, then we can also solve the search problem But the complexity grows by a factor of π‘žβ‹…π‘› So this reduction only works for small (polynomial) π‘ž

8 Reducing Search to Decision LWE
Assume that we have a distinguisher D that can tell if 𝒃=𝐀𝒔+𝑒 (π‘šπ‘œπ‘‘ π‘ž) or 𝒃 is random Say for now that D succeeds with probability close to 1 We construct a solver S that finds s For every index π‘–βˆˆ{1..𝑛} and every value π‘£βˆˆ 𝑍 π‘ž , S will use D to determine if 𝒔 𝑖 =𝑣

9 Reducing Search to Decision LWE
Given 𝑨 and 𝒃=𝑨𝒔+𝒆, test if 𝒔 𝑖 =𝑣: Choose 𝒓=( π‘Ÿ 1 , π‘Ÿ 2 ,…, π‘Ÿ π‘š )∈ 𝑍 π‘ž π‘š uniformly at random Add 𝒓 to the 𝑖’th column of 𝑨, this gives a matrix 𝑨′ 𝑨′ is uniformly random because 𝑨 is Note that 𝑨 β€² 𝒔=𝑨𝒔+ 𝒔 𝑖 ⋅𝒓 𝑨′ 𝟎.. 𝒓 𝟏 ..𝟎 𝟎.. 𝒓 𝟐 ..𝟎 𝟎.. 𝒓 π’Ž ..𝟎 𝑨 = +

10 Reducing Search to Decision LWE
Given 𝑨 and 𝒃=𝑨𝒔+𝒆, test if 𝒔 𝑖 =𝑣: Choose 𝒓=( π‘Ÿ 1 , π‘Ÿ 2 ,…, π‘Ÿ π‘š )∈ 𝑍 π‘ž π‘š uniformly at random Add 𝒓 to the 𝑖’th column of 𝑨, this gives a matrix 𝑨′ 𝑨′ is uniformly random because 𝑨 is Add 𝑣⋅𝒓 to 𝒃, this gives the vector 𝒃′ 𝒃′ 𝒃 𝒓 𝟏 𝒓 𝟐 𝒓 π’Ž = + 𝑣⋅

11 Reducing Search to Decision LWE
Given 𝑨 and 𝒃=𝑨𝒔+𝒆, test if 𝒔 𝑖 =𝑣: Choose 𝒓=( π‘Ÿ 1 , π‘Ÿ 2 ,…, π‘Ÿ π‘š )∈ 𝑍 π‘ž π‘š uniformly at random Add 𝒓 to the 𝑖’th column of 𝑨, this gives a matrix 𝑨′ 𝑨′ is uniformly random because 𝑨 is Add 𝑣⋅𝒓 to 𝒃, this gives the vector 𝒃′ 𝒃 β€² =𝒃+𝑣⋅𝒓 =𝑨𝒔+𝒆+𝑣⋅𝒓 = 𝑨 β€² π’”βˆ’ 𝒔 𝑖 ⋅𝒓 +𝒆+𝑣⋅𝒓 = 𝑨 β€² 𝒔+𝒆+ π‘£βˆ’ 𝒔 𝑖 ⋅𝒓

12 Reducing Search to Decision LWE
Given 𝑨 and 𝒃=𝑨𝒔+𝒆, test if 𝒔 𝑖 =𝑣: Choose random 𝒓, compute 𝑨 β€² , 𝒃′ Such that 𝒃 β€² = 𝑨 β€² 𝒔+𝒆+ π‘£βˆ’ 𝒔 𝑖 ⋅𝒓 If 𝒔 𝑖 =𝑣 then we get 𝒃 β€² = 𝑨 β€² 𝒔+𝒆 Otherwise 𝒃 β€² is uniform (because 𝒓 is uniform) Use the distinguisher 𝐷( 𝑨 β€² , 𝒃 β€² ) to tell which case it is This will tell us if 𝒔 𝑖 =𝑣

13 Reducing Search to Decision LWE
The reduction assumes that D is always right Can be extended to distinguisher D with polynomially small advantage The reduction works in time linear in π‘›β‹…π‘ž Can be refined to work in time π‘›β‹…βˆ‘ 𝑝 𝑖 The 𝑝 𝑖 ’s are the prime factors of π‘ž So the reduction can be efficient even for large π‘ž, as long as it is smooth

14 A Useful Variant of LWE Instead of choosing the secret 𝒔 uniformly, choose it from the same distribution as 𝒆 So 𝒔 is small Theorem [ACPS’09]: Uniform-secret LWE is equivalent to small-secret LWE Solving one solving the other

15 Uniform- vs. Small-secret LWE
Easy direction: If we can solve uniform-secret LWE then we can solve small-secret LWE We are given 𝑨 and 𝒃=𝑨𝒔+𝒆 𝒔 is a small secret Choose a uniform random 𝒓 Set 𝒃 β€² =𝑨𝒓+𝒃=𝑨 𝒓+𝒔 +𝒆 (π‘šπ‘œπ‘‘ π‘ž) 𝒔 β€² =𝒓+𝒔 is uniform (because 𝒓 is uniform) 𝑨,𝒃′=𝑨𝒔′+𝒆 is instance of uniform-secret LWE Solving it, we get 𝒔′ and can compute 𝒔= 𝒔 β€² βˆ’π’“

16 Uniform- vs. Small-secret LWE
Hard direction: If we can solve small-secret LWE then we can solve uniform-secret LWE But the parameter π‘š changes For solving π‘šΓ—π‘› uniform-secret LWE, we would need to solve π‘šβ€²Γ—π‘› small-secret LWE with π‘š β€² =π‘šβˆ’π‘› We are given 𝑨 and 𝒃=𝑨𝒔+𝒆 𝒔 is a uniform secret Find 𝑛 linearly-independent rows of 𝑨 Such rows exist with high probability Assume that these are the first n rows

17 Uniform- vs. Small-secret LWE
𝑛 𝑛 𝑨 𝑨 𝟐 𝑨 𝟏 𝒃 𝒃 𝟏 𝑛 = 𝑨 𝟏 𝒔+ 𝒆 𝟏 = = π‘š 𝒃 𝟐 π‘š β€² = 𝑨 𝟐 𝒔+ 𝒆 𝟐 Set 𝑨 β€² =βˆ’ 𝑨 2 𝑨 1 βˆ’1 and 𝒃 β€² = 𝒃 2 + 𝑨 β€² 𝒃 𝟏 𝒃 β€² = 𝑨 2 𝒔+ 𝒆 2 + 𝑨 β€² 𝑨 1 𝒔+ 𝒆 = 𝑨 2 𝒔+ 𝑨 β€² 𝑨 1 𝒔+ 𝑨 β€² 𝒆 1 + 𝒆 2 = 𝑨 β€² 𝒆 1 + 𝒆 2 Because 𝑨 β€² 𝑨 1 =βˆ’ 𝑨 2 𝑨 1 βˆ’1 𝑨 1 =βˆ’ 𝑨 2 So ( 𝑨 β€² , 𝒃 β€² = 𝑨 β€² 𝒆 1 + 𝒆 2 ) is instance of short-secret LWE The secret is 𝒆 1 , drawn from the error distribution Solving it we get 𝒆 1 Then compute 𝒔= 𝑨 𝟏 βˆ’πŸ ( 𝒃 𝟏 βˆ’ 𝒆 𝟏 )

18 Regev’s Cryptosystem [R’05]
Secret key: vector 𝒔′ Public key: Matrix 𝑨′, vector 𝒃=𝑨′ 𝒔 β€² +𝒆 Denote 𝑨=( 𝒃|𝑨 β€² ) If decision-LWE is hard then A is pseudorandom Denote 𝒔= 𝟏,βˆ’ 𝒔 β€² , then 𝑨𝒔=π’ƒβˆ’ 𝑨 β€² 𝒔 β€² =𝒆 Encrypt𝑨 𝜎∈{0,1} Choose a random small vector π’“βˆˆ 0,1 π‘š Output the ciphertext 𝒄=𝒓𝑨+ π‘ž 2 β‹… 𝜎,0,…,0 ∈ 𝜎 𝑍 π‘ž 𝑛 Decrypt𝒔(𝒄) Compute the inner product 𝑦= 𝒄,𝐬 (mod q) Output 0 if |𝑦|<π‘ž/4, else output 1

19 Regev’s Cryptosystem [R’05]
Correctness: 𝑦= 𝒄,𝐬 = 𝒓𝑨+ π‘ž 2 𝜎 ,𝒔 = 𝒓𝑨𝒔+ π‘ž 2 𝜎0…0 , 1, βˆ’π’” β€² = 𝒓,𝒆 + π‘ž 2 β‹…πœŽ 𝒓,𝒆 < π‘ž 4 (since 𝒓 is 0-1 vector and 𝒆 ∞ < π‘ž 4 ) If 𝜎=0 then 𝑦 < π‘ž 4 , if 𝜎=1 then 𝑦 > π‘ž 4 Security: Recall that A is pseudo-random We show that if A was random then 𝒄 was statistically close to uniform, regardless of 𝜎

20 Regev’s Cryptosystem [R’05]
The Leftover Hash Lemma [HILL’99] implies the following corollary: If π‘š>3𝑛 log π‘ž then the two distributions < 𝑨, 𝒓𝑨 :𝐴 ∈ π‘ˆ 𝑍 π‘ž π‘šΓ—π‘› , 𝒓 ∈ π‘ˆ 0,1 π‘š > < 𝑨, 𝒖 : 𝐴 ∈ π‘ˆ 𝑍 π‘ž π‘šΓ—π‘› , 𝒖 ∈ π‘ˆ 𝑍 π‘ž 𝑛 > are statistically close (upto π‘ž βˆ’Ξ©(π‘š) ) For a random 𝐴, 𝒓𝐴 is close to uniform Even conditioned on A And therefore so is 𝒓𝐴+ π‘ž 2 𝜎 If 𝐴 is pseudorandom, so is 𝒓𝐴+ π‘ž 2 𝜎

21 A Useful Variant of the Cryptosystem
Encrypt: 𝒄=2𝒓𝑨+ 𝜎 instead of 𝒄=𝒓𝑨+ π‘ž 2 𝜎 from before Plaintext encoded in the LSB rather than MSB Decrypt: y= 𝒄,𝐬 (π‘šπ‘œπ‘‘ π‘ž), then 𝜎=𝑦 π‘šπ‘œπ‘‘ 2 𝑦=2 𝒓,𝒆 +𝜎 (π‘šπ‘œπ‘‘ π‘ž) 2 𝒓,𝒆 <π‘ž/2, so no mod-π‘ž reduction  𝑦 π‘šπ‘œπ‘‘ 2=𝜎

22 The Hardness of LWE

23 Lattices and Hard Problems
A lattice is just an additive subgroup of Rn.

24 Lattices v2’ v2 v1’ v1 Lattice of rank n = set of all integer linear combinations of n linearly independent basis vectors.

25 Lattices A Lattice has infinitely many bases
They are related by unimodular matrices, 𝐡 β€² =π΅π‘ˆ π‘ˆ is an integer matrix with det π‘ˆ =Β±1 All bases have the same determinant (upto sign) This quantity is the determinant of the lattice Given any set of vectors that span the lattice, can compute a canonical basis Hermite normal form (HNF)

26 Lattices A β€œgood basis” has all small vectors
β€œclose to orthogonal” to each other Typically the HNF is a β€œbad” basis Minkowsky’s theorems: A rank-𝑛 lattice with determinant 𝑑 has A non-zero vector of length |𝑣|≀ 𝑛 β‹… 𝑑 1/𝑛 𝑛 linearly independent 𝑣 𝑖 β€˜s s.t. 𝑖=1 𝑛 | 𝑣 𝑖 | ≀ 𝑛 𝑛/2 ⋅𝑑 Also a basis of vectors of similar sizes Lattice reduction: Given a β€œbad” basis, find a β€œgood” one for the same lattice

27 Lattices and Hard Problems
v2’ v2 v1’ v1 Given some basis of L, may be hard to find good basis of L. Hard to solve the (approx) shortest/closest vector problems.

28 Hard Problems Given a basis 𝐡 for a lattice 𝐿(𝐡):
Shortest-Vector Problem (SVP) Find the shortest nonzero vector in L(B) Or maybe just compute the size of such vector ( πœ† 1 𝐿 ) Shortest Independent-Set Problem (SIVP) Find 𝑛 linearly independent 𝑣 1 ,…, 𝑣 𝑛 minimize max 𝑖 | 𝑣 𝑖 | Or maybe just the quantity πœ† 𝑛 𝐿 = max 𝑖=1 𝑛 | 𝑣 𝑖 | Also approximation versions Find 𝑣 such that 𝑣 ≀𝛾⋅ shortest Find 𝑣 𝑖 ’s such that max 𝑖 | 𝑣 𝑖 | ≀𝛾⋅ smallest-possible

29 Hard Problems: What’s Known?
The [LLL’82] algorithm and its variants can approximate SVP upto 𝛾= 2 O(𝑛) NP-hard to approx. SVP upto 𝛾= 2 log 1βˆ’πœ– 𝑛 𝛾=πœ”(1) but 𝛾< 𝑛 πœ– for any πœ– Roughly: approximate upto 2 𝑛/π‘˜ takes time 2 𝑂(π‘˜) Practically we can perhaps approximate SVP upto 𝛾= 2 𝑛/100 but not upto 𝛾= 2 𝑛/200 At least for moderate 𝑛’s (say 𝑛<500) Similar for SIVP

30 LWE and Lattices Consider the matrix 𝑨=
𝒂 𝟏 … 𝒂 𝒏 Consider the matrix 𝑨= The column space mod-π‘ž is a rank-π‘š lattice, spanned by the columns of 𝐡= A discrete additive subgroup of 𝑅 π‘š Can compute its HNF basis 𝒃=𝑨𝒔+𝒆 (π‘šπ‘œπ‘‘ π‘ž) is close to this lattice 𝒗=π’ƒβˆ’π’† is in the lattice, at distance |𝒆| from 𝒃 We have a bound 𝛽β‰ͺπ‘ž on |𝒆| whp (say 𝛽= π‘ž ) If we find 𝒗, we can solve for 𝒔 π‘ž 0 0 π‘ž β‹± 0 0 π‘ž 𝒂 𝟏 … 𝒂 𝒏

31 Bounded Distance Decoding (BDD)
Input: a basis B, another point π‘₯, a bound 𝛽 Goal: find π‘£βˆˆπΏ(𝐡) such that π‘₯βˆ’π‘£ ≀𝛽 Solving BDD  Solving LWE Thm [Babai’86,GPV’08]: Solving SIVP  Solving BDD Given a basis for 𝐿 with max 𝑖 | 𝑣 𝑖 | =𝛼, can solve BDD upto distance π›½β‰ˆπ›Όβ‹…poly(𝑛)

32 LWE and Lattices Thm [Reg’05, Pei’09]: Solving LWE  Solving SIVP, SVP
LWE-solver with error-bound 𝛽<π‘ž/𝑂( 𝑛 ) implies quantum approximation of SIVP upto a factor poly(𝑛) Or a classical algorithm for approximating πœ† 1 𝐿 upto a factor poly(𝑛)

33 Summary Learning with Errors: 𝒃=𝑨𝒔+𝒆 This is a hard problem
For some parameters, can be shown to be as hard as some well-known lattice problems Even for other settings, we don’t know how to solve it Only known attacks use lattice reduction These only work when π‘ž/|𝒆|=exp⁑(𝑛) LWE is useful for cryptography For example for public-key encryption Decryption formula 𝑠,𝑐 π‘šπ‘œπ‘‘ π‘ž π‘šπ‘œπ‘‘ 2


Download ppt "Background: Lattices and the Learning-with-Errors problem"

Similar presentations


Ads by Google