Intro to Lattice-based cryptography

The main reference is Mathematics of Public Key Cryptography by Steven Galbraith and J. Silverman's note for PCMI 2022.

Lattice

In a vector space Rn, a lattice is a discrete subgroup which is equivalent to Z-span of a basis. For example, Z-span of v1=(1,0) and v2=(0,1),
L=Zv1,v2={(c1,c2)c1,c2Z}
is a lattice.

Like a vector space, a single lattice can have various bases. For example, w1=(2,1) and w2=(1,1) spans the same L. To check a certain basis spans the lattice, we need to see basis basis-changing matrix. Since {v1,v2} and {w1,w2} are both R-basis, we have an invertible matrix A such that
(w1|w2)=A(v1|v2)
Then, two bases span the same lattice if and only if AGLn(Z), that is, entries of A are all integers and detA=±1. In our example, A=(2111) whose determinant is 1. For future applications, we will define the fundamental domain of a lattice with respect to a basis
F(L,v1,,vn)={c1v1++cnvn0ci<1}

Hard Lattice Problems

Like a prime factorization in RSA, we will need a hard problem for cryptographic applications. For a given lattice L and zRn, the closest vector problem (CVP) is to find a lattice point that is closest to the target point z. That is,
CVP(L,z)=argminvLvz

A generous version of CVP is the approximate closed vector problem (κ-CVP). This problem is to find a reasonably close vector to z. Formally, for κ1, the solution satisfies
κ-CVP(L,z)zκminvLvz
If κ=1, κ-CVP is equivalent to CVP.

In RSA, we can solve the hard problem easily with a private key. The same thing happens for lattice problems. A private key will be a "good" basis (I will explain it precisely later). With a good basis, we can solve κ-CVP easily using Babai's rounding-off algorithm. The algorithm is simple. Given a lattice L and a basis {v1,,vn}, the target point zRn can be written as z=c1v1++cnvn. Then, the output is [c1]v1++[cn]vn, where [ci] is the integer closest to ci. We hope this vector is a solution to CVP, but it's not in general.

In the previous example, let the target point z=(0.2,0.2). With basis {v1,v2}, z=0.2v10.2v2, so Babai's rounding-off algorithm outputs (0,0), which is a correct answer to CVP. But, with basis {w1,w2}, z=0.4w10.6w2, so the output is w2=(1,1). Babai's rounding-off algorithm highly depends on the basis, one can see that the rounding-off algorithm with the first basis {v1,v2} solves every CVP because v1 and v2 are orthogonal. So, the desired "good" property is "nearly orthogonal" which can be formalized by LLL-reduced condition. And, with an LLL-reduced basis, we can solve κ-CVP for some κ. I will explain this in another post. Let's just note that some efficient algorithm with a "good" basis can solve κ-CVP.

Goldreich-Goldwasser-Halevi Cryptosystem

GGH cryptosystem is based on the hardness of CVP. The private key is a "good" basis B={v1,,vn}. We can consider the lattice L spanned by B With private key, one can make a "bad" basis B=UB for some random integer matrix with determinant ±1. Then, B is also a basis of L, and it is a public key. With the public key B and a message mZn, the ciphertext is x=Bm+e where eRn is a random small vector. Note that the vector Bm belongs to the lattice L. We want e is small enough so that the closest lattice point of x is Bm. With a knowledge of the good basis B, one can decrypt the ciphertext by solving CVP and multiply B1.
One way to attack the GGH system is to obtain another good basis from public key B using LLL reduction. To prevent this, the size of the lattice should be large enough.

The problem with GGH is the length of the keys. To prevent known attacks on GGH, we need large n>2000. But, the size of public/private keys of GGH is O(n2), which is really large even compared to secure 4096 bits RSA.

NTRU Cryptosystem

We first define a binary operation convolution on Zn. For (ai),(bi)Zn, define
(ai)(bi)=(ci),    ci=j+ki mod najbk.
Note that this convolution is the same as the multiplication in Z[X]/(Xn1), by interpreting (ai) as a0+a1x++an1xn1. Similarly, we can define convolution p on (Z/pZ)n for any integer p.

The public/private keys of NTRU are generated like this. First, choose a prime n and two integers p<<q. Then choose small f,gZn and find fp,fqZn such that
f¯pfp¯=(1,0,0,0),    f¯qfq¯=(1,0,0,0).
Here, f¯ is a projection from Zn to (Z/pZ)n or (Z/qZ)n (which is certain in context). The public key is h=g¯qfq¯ and the private key is f. For a small message m(Z/pZ)n, the ciphertext is
c=pr¯qh+m mod q
where r is a small random vector.
To recover the ciphertext c, first compute
a=cqf¯=(pr¯qgqfq+m)qf¯=pr¯qg+mqf¯ mod q
The equation above is in (Z/qZ)n. But, since f,g,r,m are small and p<<q,
a=pr¯qg+mqf¯Zn
Now, multiplying fp to obtain
apfp¯=pr¯qgpfp¯+mqf¯pfp¯=m mod p

We want to interpret this cryptosystem as a lattice problem. We first convert the convolution relation into a lattice membership problem. Let h=(h0,,hn1)Zn and

Bh=(In0h0h1hn1hn1h0hn2h1h2h0qIn)

Let Lh be the lattice spanned by Bh. Suppose a,bZn satisfies

a¯qh¯=b¯ mod q.

This implies we have uZn such that

qu=bah

Then, Bh(au)=(ab)Lh. One can also show that (ab)Lh if and only if a¯qh¯=b¯.

In the NTRU cryptosystem, the ciphertext is

c=pr¯qh+m mod q

This equation is equivalent to

(0|c)=(0|pr¯qh+m)=(r|rph)+(r,m)

Since r,m is small and (r|rph)Lph, recovering m is equivalent to solve CVP for (0|c). In other words, NTRU is based on a lattice problem for special type lattice Bph. The circular property of the basis reduces the length of keys into O(nlogn).

댓글