Basic Cryptanalysis Vadim Lyubashevsky INRIA / ENS, Paris - - PowerPoint PPT Presentation

basic cryptanalysis
SMART_READER_LITE
LIVE PREVIEW

Basic Cryptanalysis Vadim Lyubashevsky INRIA / ENS, Paris - - PowerPoint PPT Presentation

Basic Cryptanalysis Vadim Lyubashevsky INRIA / ENS, Paris Lattice-Based Crypto & Applications 1 Bar-Ilan University, Israel 2012 Outline LLL sketch Application to Subset Sum Application to SIS Application to LWE Lattice


slide-1
SLIDE 1

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 1

Basic Cryptanalysis

Vadim Lyubashevsky INRIA / ENS, Paris

slide-2
SLIDE 2

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 2

Outline

  • LLL sketch
  • Application to Subset Sum
  • Application to SIS
  • Application to LWE
  • Lattice Reduction in Practice
slide-3
SLIDE 3

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 3

Small Integer Solution Problem (SIS) Learning With Errors Problem (LWE) One-Way Functions Collision-Resistant Hash Functions Digital Signatures Identification Schemes (Minicrypt) Public Key Encryption … (Cryptomania) Worst-Case Average-Case

BDD SIVP quantum How hard are these problems??

slide-4
SLIDE 4

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 4

LLL

[Lenstra, Lenstra, Lovasz ‘82]

slide-5
SLIDE 5

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 5

Lattice Bases

slide-6
SLIDE 6

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 6

The Goal of Lattice Reduction

Obtain a basis B in which the Gram-Schmidt vectors are not decreasing too quickly This roughly means that the basis vectors are somewhat orthogonal to each other

slide-7
SLIDE 7

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 7

LLL Reduced Basis B

1 μ2,1 μ3,1 … μn,1 1 μ3,2 … μn,2 … 1 … μn,3 … … … … … … 1 … …

b̃1 b̃2 b̃3 … b̃n

… …

B =

An LLL-reduced basis has:

  • 1. All |μi,j|≤ 0.5
  • 2. 0.75||b̃i||2 ≤ ||μi+1,ib̃i + b̃i+1 ||2

μi,j = (bi ∙ b̃j)/||b̃j||2 ||b̃i+1||2 ≥ 0.5||b̃i||2

slide-8
SLIDE 8

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 8

Short Vector in an LLL-reduced Basis

Thm: The vector b1 in an LLL-reduced basis has length at most 2(n-1)/2∙λ1(L(B)) Proof: ||b̃n||2 ≥ 0.5||b̃n-1||2 ≥ … ≥ 0.5n-1||b̃1||2= 0.5n-1||b1||2 ||b1|| ≤ 2(n-1)/2||b̃i|| for all i Since, mini ||b̃i|| ≤ λ1(L(B)), we have ||b1|| ≤ 2(n-1)/2∙λ1(L(B))

slide-9
SLIDE 9

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 9

LLL Algorithm

1 μ2,1 μ3,1 … μn,1 1 μ3,2 … μn,2 … 1 … μn,3 … … … … … … 1 … …

b̃1 b̃2 b̃3 … b̃n

… …

=

An LLL-reduced basis has:

  • 1. All |μi,j|≤ 0.5
  • 2. 0.75||b̃i||2 ≤ ||μi+1,ib̃i + b̃i+1 ||2

… …

b1 b2 b3 … bn

… …

slide-10
SLIDE 10

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 10

LLL Algorithm

1 ≤ ½ ≤ ½ … ≤ ½ 1 ≤ ½ … ≤ ½ … 1 … ≤ ½ … … … … … … 1 … …

b̃1 b̃2 b̃3 … b̃n

… …

=

An LLL-reduced basis has:

  • 1. All |μi,j|≤ 0.5
  • 2. 0.75||b̃i||2 ≤ ||μi+1,ib̃i + b̃i+1 ||2

… …

b1 b2 b3 … bn

… …

slide-11
SLIDE 11

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 11

LLL Algorithm

1 ≤ ½ ≤ ½ … ≤ ½ 1 ≤ ½ … ≤ ½ … 1 … ≤ ½ … … … … … … 1 … …

b̃1 b̃2 b̃3 … b̃n

… …

=

An LLL-reduced basis has:

  • 1. All |μi,j|≤ 0.5
  • 2. 0.75||b̃i||2 ≤ ||μi+1,ib̃i + b̃i+1 ||2

… …

b1 b2 b3 … bn

… … swap

slide-12
SLIDE 12

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 12

LLL Algorithm

… …

b̃1 b̃2 b̃3 … b̃n

… …

=

An LLL-reduced basis has:

  • 1. All |μi,j|≤ 0.5
  • 2. 0.75||b̃i||2 ≤ ||μi+1,ib̃i + b̃i+1 ||2

… …

b1 b2 b3 … bn

… … swap 1 μ2,1 μ3,1 … μn,1 1 μ3,2 … μn,2 … 1 … μn,3 … … … … … … 1

slide-13
SLIDE 13

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 13

APPLICATION OF LLL: THE SUBSET SUM PROBLEM

slide-14
SLIDE 14

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 14

ai , T in ZM ai are chosen randomly T is a sum of a random subset of the ai a1 a2 a3 … an T Find a subset of ai's that sums to T (mod M)

Subset Sum Problem

slide-15
SLIDE 15

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 15

ai , T in Z49 ai are chosen randomly T is a sum of a random subset of the ai 15 31 24 3 14 11 15 + 31 + 14 = 11 (mod 49)

Subset Sum Problem

slide-16
SLIDE 16

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 16

How Hard is Subset Sum?

ai , T in ZM a1 a2 a3 … an T Find a subset of ai's that sums to T (mod M) Hardness Depends on:

  • Size of n and M
  • Relationship between n and M
slide-17
SLIDE 17

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 17

Complexity of Solving Subset Sum

M run-time

2log²(n) 2n 2n log(n) 2n² poly(n) 2Ω(n) poly(n) “generalized birthday attacks” [FlaPrz05,Lyu06,Sha08] “lattice reduction attacks” [LagOdl85,Fri86]

slide-18
SLIDE 18

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 18

Subset Sum and Lattices

a1 a2 a3 … an T=(Σaixi mod M) for xi in {0,1} a = (a1, a2, … , an, -T) L⊥(a) = {y in Zn+1 : a∙y = 0 mod M} Notice that x=(x1, x2, … ,xn,1) is in L⊥(a) ||x|| < √(n+1) Want to use LLL to find this x

slide-19
SLIDE 19

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 19

When Will LLL Solve Subset Sum?

L⊥(a) = {y in Zn+1 : a∙y = 0 mod M} Notice that x=(x1, x2, … ,xn,1) is in L⊥(a), ||x|| < √(n+1) LLL can find a vector < δn+1λ1(L⊥(a) ) < δn+1 √(n+1) So if there are no other vectors in L⊥(a) of length < δn+1√(n+1), LLL must find x=(x1, x2, … ,xn,1) ! Caveat: ±x, ± 2x, ± 3x, … are all in L⊥(a), but we could recover x from these Good vectors: (kx1, kx2, … ,kxn,k)

slide-20
SLIDE 20

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 20

The “Bad” Vectors

y=(y1, … ,yn,k) such that ||y||< δn+1 √(n+1) = r and a1y1 + … + anyn - kT = 0 mod M a1y1 + … + anyn - k(a1x1 + … + anxn) = 0 mod M a1(y1 - kx1) + … + an(yn - kxn) = 0 mod M

(and for some i, yi - kxi ≠ 0 mod M)

slide-21
SLIDE 21

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 21

Probability of a Bad Lattice Vector

Sr = { y in Zn+1, ||y|| < r} For any (x1,…,xn) in {0,1}n and (y1, … ,yn,k) in Sr

:

Pra1, … ,an[a1(y1 - kx1) + … + an(yn - kxn) = 0 mod M] = 1/M unless (yi - kxi) = 0 mod M for all i

(the last line assumes that M is prime)

slide-22
SLIDE 22

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 22

Probability of a Bad Lattice Vector

Sr = { y in Zn+1, ||y|| < r} For all (x1,…,xn) in {0,1}n and (y1, … ,yn,k) in Sr

such

that yi - kxi ≠ 0 mod M for some i : Pra1, … ,an[a1(y1 - kx1) + … + an(yn - kxn) = 0 mod M] ≤ |Sr| ∙ 2n /M Want |Sr| ∙ 2n << M

slide-23
SLIDE 23

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 23

Number of Zn Points in a Sphere

# of integer points in a sphere of radius r ≈ volume of sphere of radius r ≈ (πn)-1/2(2πe/n)n/2 rn

(r needs to be at least n1/2+ε)

slide-24
SLIDE 24

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 24

Probability of a Bad Lattice Vector

Want |Sr| ∙ 2n << M, where r = δn+1 √(n+1) |Sr| ∙ 2n < 9n+1 ∙ δ(n+1)2 If M > 9n+1 ∙ δ(n+1)2, subset sum can be solved in poly-time

(for all but a negligible number of instances)

slide-25
SLIDE 25

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 25

APPLICATION OF LLL: THE SIS PROBLEM

slide-26
SLIDE 26

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 26

The SIS Problem

A

s = 0 (mod q)

n m Given a random A in Zq

n x m,

Find a “small” s such that As = 0 mod q

(We will only consider m ≥ 2n and q > m)

slide-27
SLIDE 27

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 27

Finding “Small” Vectors Using LLL

L⊥(A) = {y in Zm : Ay = 0 mod q} What is the shortest vector of L⊥(A) ? Minkowski’s Theorem: λ1(L⊥(A)) ≤ √m det(L⊥(A))1/m What is det(L⊥(A))1/m ?

slide-28
SLIDE 28

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 28

Determinant of an Integer Lattice

If L is an integer lattice, then det(L) = # (Zm/ L )

  • 1. #(Zm/ L⊥(A)) ≤ qn

For any x1, x2 in Zm, if Ax1= Ax2 mod q, then x1, x2 are in the same coset of Zm/ L⊥(A).

  • 2. If A has n linearly-independent columns, then

#(Zm/ L⊥(A)) = qn

For every y in Zq n, there is an

x in Zm such that Ax=y mod q

slide-29
SLIDE 29

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 29

Shortest Vector in L⊥(A)

Minkowski’s Theorem: λ1(L⊥(A)) ≤ √m det(L⊥(A))1/m For almost all A, det(L⊥(A)) = qn Thus, λ1(L⊥(A)) ≤ √m qn/m Can it be much smaller?? If qn/m >> √2πe , then No.

slide-30
SLIDE 30

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 30

Shortest Vector in L⊥(A)

Sr = { y in Zm, ||y|| < r} For any s≠0 mod q in Sr, PrA[As = 0 mod q] = 1/qn For all s≠0 mod q in Sr, PrA[As = 0 mod q] ≤ |Sr|/qn ≈ (πm)-1/2(2πe/m)m/2 rm / qn r needs to be ≈ √m/(2πe)qn/m

(since we assumed, qn/m >> √2πe, we have r >> √m, and so

# of integer points in a sphere of radius r ≈ volume of sphere of radius r)

slide-31
SLIDE 31

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 31

Shortest Vector in L⊥(A)

For almost all A in Zq

n x m, when qn/m >> √2πe

(1-ε)√m/(2πe)qn/m ≤ λ1(L⊥(A)) ≤ √m qn/m

Experiments show that it’s closer to this Using LLL, can find a vector of length δm∙ √m/(2πe)qn/m

  • Sometimes, to break a system, need to

bound the infinity norm, so could be harder

  • Sometimes it makes sense to not use all

m columns

slide-32
SLIDE 32

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 32

APPLICATION OF LLL: THE LWE PROBLEM

slide-33
SLIDE 33

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 33

The LWE Problem

A

s e b + =

m n ||e|| is small find s

mod q

slide-34
SLIDE 34

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 34

Decision LWE

A

s e b + =

A

b

Valid LWE Distribution Uniformly Random

slide-35
SLIDE 35

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 35

Solve SIS to Solve LWE

A

v

= 0 mod q

Using LLL, can find a vector v of length δm∙ √m/(2πe)qn/m (set m optimally, to minimize the length of v)

slide-36
SLIDE 36

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 36

Solve SIS to Solve LWE

b

v

Using LLL, can find a vector v of length δm∙ √m/(2πe)qn/m (set m optimally, to minimize the length of v) Compute v∙b mod q.

slide-37
SLIDE 37

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 37

Solve SIS to Solve LWE

v

Using LLL, can find a vector v of length δm∙ √m/(2πe)qn/m (set m optimally, to minimize the length of v) Compute v∙b mod q. If b=As+e, then v∙b = v∙e is small.

A

s e +

slide-38
SLIDE 38

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 38

Solve SIS to Solve LWE

b

v

Using LLL, can find a vector v of length δm∙ √m/(2πe)qn/m (set m optimally, to minimize the length of v) Compute v∙b mod q. If b=As+e, then v∙b = v∙e is small. If b is uniform, then v∙b mod q is uniform.

slide-39
SLIDE 39

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 39

Solve SIS to Solve LWE

Using LLL, can find a vector v of length δm∙ √m/(2πe)qn/m (set m optimally, to minimize the length of v) Compute v∙b mod q. If b=As+e, then v∙b = v∙e is small. If b is uniform, then v∙b mod q is uniform. ||v∙e|| ≤ ||v|| ∙ ||e|| ≤ δm∙ √m/(2πe)qn/m ||e|| So, if δm∙ √m/(2πe)qn/m ||e|| < q/2, can solve decision LWE and then search LWE as well

slide-40
SLIDE 40

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 40

A Different Algorithm

  • The previous algorithm assumed we could obtain a lot of
  • samples. Many crypto applications do not provide this.
  • If we don’t have a lot of samples – can use “sample-

preserving” reduction from search to decision LWE [MicMol ‘11]

  • In some cases, that reduction does

not apply (e.g. ideal lattices …)

slide-41
SLIDE 41

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 41

LWE Problem With Few Samples

A

s e b + =

n n ||e|| and ||s|| are small. find s.

mod q

slide-42
SLIDE 42

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 42

LWE Problem With Few Samples

A

s e

b

= 0 mod q

n 2n+1

I

  • 1

L⊥(A’)={y in Z2n+1

: [A|I|b]y = 0 mod q}

Can show that for most A, the “bad” vectors have length at least (1-ε)√m/(2πe)qn/m

slide-43
SLIDE 43

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 43

Important Caveat

L⊥(A’)={y in Z2n+1

: [A|I|b]y = 0 mod q}

Can show that for most A, the “bad” vectors have length at least (1-ε)√m/(2πe)qn/m Can find s,e if ||s|e|-1|| ≤ δm (1-ε)√m/(2πe)qn/m What if LLL does not find s,e? Then it will act as if the short vector s|e|-1 does not exist!

slide-44
SLIDE 44

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 44

IN PRACTICE

[Gama and Nguyen ‘08]

slide-45
SLIDE 45

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 45

Two Types of Problems

Short Vector given A, find a short s such that As=0 mod q ||s|| is greater than det1/m Unique Short Vector given A and As mod q, find this short s ||s|| is less than det1/m

slide-46
SLIDE 46

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 46

Unique Short Vector Problem

Looking for very short vector s The next shortest vector not equal to ks is v The hardness of finding s depends on ||v|| / ||s|| Let α = ||v|| / ||s|| = λ2/ λ1

slide-47
SLIDE 47

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 47

Short Vector Problem

Looking for vector s such that As = 0 mod q (and there are no very short vectors in L⊥(A)) The shortest s that can be found depends on α =||s|| / det(L⊥(A))1/m

slide-48
SLIDE 48

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 48

Two Types of Problems

  • Short Vector

i.e. given A, find a short s such that As=0 mod q α =||s|| / det(L⊥(A))1/m

  • Unique Short Vector

i.e. given A and As mod q, find this short s A’=[A|As] α = λ2(L⊥(A’)) / ||s|| ≈ λ1(L⊥(A)) / ||s||

α=1.02m Can be broken using LLL α=1.01m Can be broken using BKZ (improvement of LLL) α=1.007m Seems quite secure for now α=1.005m Seems quite secure for the foreseeable future

slide-49
SLIDE 49

Lattice-Based Crypto & Applications Bar-Ilan University, Israel 2012 49

Further References

LLL Algorithm: Oded Regev’s lecture notes www.cs.tau.ac.il/~odedr/teaching/lattices_fall_2009/index.html Cryptanalysis using lattice reduction algorithms: Nicolas Gama and Phong Nguyen: “Predicting Lattice Reduction” Oded Regev and Daniele Micciancio: “Lattice-Based Cryptography”