# A New Method of Constructing a Lattice Basis and Its Applications to Cryptanalyse Short Exponent RSA

Authors: Mingqiang Wang; Haifeng Zhang
Journal: Mathematical Problems in Engineering
 (2010)

---

## Abstract

We provide a new method of constructing an optimal
lattice. Applying our method to the cryptanalysis of the short exponent
RSA, we obtain our results which extend Boneh and Durfee's work. Our
attack methods are based on a generalization to multivariate modular polynomial
equation. The results illustrate the fact that one should be careful
when using RSA key generation process with special parameters.


---

## Body

## 1. Introduction

The RSA [1] cryptosystem is the most widely used public-key cryptosystem. The modulo N of RSA cryptosystem is the product of two large prime numbers p and q, without loss of generality, we assume that p<q. The public exponent e and the secret exponent d satisfy the equation(1.1)ed≡1(modϕ(N)),
where ϕ(N)=(p-1)(q-1) is Euler’s totient function. In a typical RSA cryptosystem, p and q have approximately the same number of bits and e<N. The most basic security requirement for public key cryptosystem is that it should be hard to recover the secret key from the public key.In order to speed up the decryption or signing process, one might be tempted to use small secret exponent. Unfortunately, Wiener [2] showed that if d<N1/4, then the factorization of N can be found in polynomial time using only the public information (N,e). In 1996, Coppersmith [3] introduced two methods for finding small roots of polynomial equations using lattice reduction, where one is for the univariate modular case and the other is for the bivariate case over the integers. Coppersmith’s technique has been found many applications for breaking variants of RSA; for example, Boneh and Durfee [4] improved the bound of secret exponent to d<N0.292, Coron and May [5] applied Coppersmith’s technique to show the deterministic equivalence between recovering the secret exponent d and factoring N, and May [6] presented two polynomial time attacks for the case of imbalanced prime factors p and q.For a given RSA moduloN, it is not difficult to get a polynomial time algorithm for finding [N], where [N] is the integral part of N. Then p and q can be rewritten as p=[N]-x0 and q=[N]+y0, where x0,y0 are unknown positive integers. Our observation is that the bound of secret exponent d of balanced RSA is related to the bound of |x0-y0|. For instance, when p and q are twin prime numbers, that is, q-p=2, then p is a root of the following polynomial:(1.2)N=x(x+2).
Therefore, for any security exponent d, there often exists an algorithm that factors N with polynomial time. In general case, relations between the bound |x0-y0| and the bound of secret exponent d are obtained. Boneh and Durfee’s results in [4] are special cases of our results in this paper.We reduce our method into two cases according to the size of the public exponente and obtain the results by applying a new method of constructing a lattice basis. When e is large, set fe(x,y):=x(y-A)+1, then the polynomial fe(x,y) has (k,U) as a root modulo e, where U=y0-x0 and k satisfies(1.3)ed+k(N+1-p-q)=1.
Let(1.4)gi1i2(x,y)=xi1yi2lkfe(x,y)kem-k,
for k=0,…,m, where l is a leading monomial of fe (for a detailed definition, see Section 3). All the polynomials gi1i2 have the root (k,U) modulo em. A lattice L is defined by taking the coefficient vectors of gi1i2(xX,yY) as a basis. In general, one can force the matrix of the lattice to be lower triangular. According to the LLL-algorithm, one hopes that the dimension of the lattice is as large as possible and entries of the diagonal are as small as possible. The following definitions are useful for describing our method clearly.Definition 1.1.
Suppose a latticeL is spanned by vectors {b1,b2,…,bω} and the matrix describing L is a lower triangular. A vector of which the last entry of the row exceeds the modulo of the lattice is called a bad vector. A vector of which the last entry of the row is less than the modulo of the lattice is called a good vector. A lattice spanned by a basis of which all its vectors are good is called an optimal lattice.The key ingredient of the lattice reduction technique is to construct an optimal lattice of which the dimension is as large as possible. Jochemsz and May’s strategy of constructing a lattice basis [7] is to chose a continued subset of the polynomials gi1i2 as a lattice basis in which there may be some bad vectors. Our most significant contribution is that we can discard all the unnecessary bad vectors in a lattice basis with a simple new way and construct a lattice whose dimension of the lattice is large enough. We construct an optimal lattice basis by choosing a discontinued subset of the polynomials gi1i2. When e is small, a difference polynomial is chosen; similar methods but more complicated are applied to construct a lattice basis. In order to show that our method is practical, the properties of resultant are considered also in this paper.The paper is organized as follows: some lattice preliminaries are given in Section2. Section 3 shows the proposed method of attacking the RSA with large e. Section 4 shows the method of attacking the RSA with small e. The last section is the conclusion.


## 2. Lattice Theory

Letb1,b2,…,bω∈ℤn be linearly independent vectors with ω≤n. A lattice L spanned by {b1,b2,…,bω} is the set of all integer linear combinations of b1,b2,…,bω. Such a set of vectors bi’s is called a lattice basis. We say that the lattice is full rank if ω=n.Letf(x,y)=∑i,jaijxiyj∈ℤ[x,y] be a bivariate polynomial with coefficients aij in the ring of integers. The Euclidean norm of f is defined as the norm of the coefficient vector ∥f∥2=∑ijaij2.Lemma 2.1.
LetB={b1,b2,…,bn} be a basis. On input B, the L3-algorithm outputs another basis {v1,v2,…,vn} with
(2.1)∥v1∥≤∥v2∥≤2n/4det(L)1/(n-1),
in time polynomial in n and in the bit-size of the entries in B.Based on theLLL-algorithm, Coppersmith [3] presented a method of finding small solutions to the modular polynomial which has the desired small root over the integers. Howgrave-Graham [8] formulated a useful condition on how to find such a polynomial in terms of normal of a polynomial.Lemma 2.2 (Howgrave-Graham [8]).
Leth(x,y)∈ℤ[x,y] which is the sum of at most ω monomials. Suppose that h(x0,y0)≡0modφm, where |x0|<X,|y0|<Y and ∥h(xX,yY)∥<φm/ω. Then h(x0,y0)=0 holds over the integers.


## 3. The Case for Largee

Lete,d be integers such that ed≡1(modϕ(N)). It follows that there exists an integer k satisfying(3.1)ed+k(N+1-p-q)=1.
Suppose that the public key and the security key satisfy e<Nα,d<Nβ for some α,β. In this section, we consider the case that e is of the same order of magnitude as N and therefore α is very close to 1.By (3.1), we have(3.2)k<2edN≤Nα+β-1.
Rewriting p=[N]-x0, q=[N]+y0, A=N+1-2[N], and U=y0-x0, we obtain(3.3)k(A-U)≡1(mode).
Suppose fe(x,y):=x(y-A)+1, then the polynomial fe(x,y) has (k,U) as a root modulo e.A monomiall of fe, with coefficient al, is called a leading monomial if there are no monomials in fe besides l that is divisible by l. Here the leading monomial of fe is xy and its coefficient is 1. Let ε>0 be an arbitrarily small constant. Depending on 1/ε, we fix an integer m. For k∈{0,…,m+1}, we define the sets Mk of monomials as(3.4)M0:={xi1yi2∣xi1yi2isamonomialoffem}⋃1≤j≤t{xi1yi1+j∣1≤i1≤m},Mk:={xi1yi2∣xi1yi2isamonomialoffemandxi1yi2lkisamonomialoffem-k}⋃1≤j≤t{xi1yi1+j∣k≤i1≤m},
where t is a parameter to be chosen later. We note that each set Mk in [7] is the whole monomials of fem-k, while, in our method, we discard all bad rows of the lattice and consider part monomials of fem-k.We define the following shift polynomials(3.5)gi1i2(x,y)=xi1yi2lkfe(x,y)kem-k,
for k=0,…,m, and xi1yi2∈Mk∖Mk+1.All the polynomialsgi1i2 have the root (k,U) modulo em. We define a lattice L by taking the coefficient vectors of gi1i2(xX,yY) as a basis. We can force the matrix describing L to be lower triangular. It is not difficult to see that the sets Mk can be rewritten as(3.6)M0:={xi1yi2∣0≤i2≤i1≤m}⋃1≤j≤t{xi1yi1+j∣1≤i1≤m},Mk:={xi1yi2∣k≤i2≤i1}⋃1≤j≤t{xi1yi1+j∣k≤i1≤m}.
As an example, we consider the case m=2, and t=1. From the definition of Mk, we have(3.7)M0={x2y3,x2y2,xy2,x2y,x2,xy,x,1},M1={x2y3,x2y2,xy2,x2y},M2={x2y3,x2y2}.
The matrix of the lattice for m=2 is shown in Table 1.Table 11xxyx2x2yxy2x2y2x2y3e2e2xe2*Xe2fe**XYex2e2***X2e2xfe****X2Yeyfe*****XY2ef2******X2Y2yf2*******XY3In general, we find that the conditiondet(L)<em(ω+1-n), derived from Lemmas 2.1 and 2.2, can be reduced to(3.8)Xs1Ys2<esN,for{st=∑xi1yi2∈M0it,t=1,2sN=∑k=1m|Mk|.
Assuming that |U|≤Nγ, inequality (3.8) is equivalent to(3.9)(α+β-1)s1+γs2-αsN<0.
By calculation, we obtain that(3.10)s1=m(m+1)(2m+4+3t)6,s2=m(m+1)(m+2)6+mt(m+t+2)2,sN=m(m-1)(m+1+3t)6.
For any m, the left hand side of (3.9) is minimized at t=m(1-β-γ)/2γ. Plugging this value into (3.9) and omitting a neglect number, we have(3.11)4αγ+2βγ+γ2-3β2-2γ+6β-3<0.Notice that there are some bad rows in the above lattice. Next, we refine the construction method and improve the above result. In fact, the following lattice is an optimal lattice.Fork∈{1,…,m+1}, let(3.12)tk=2-α-β-γγk,t0=max{t1,…,tm},M0:={xi1yi2∣xi1yi2isamonomialoffem}⋃0≤k≤m⋃1≤j≤tk{xi1yi1+j∣i1=k},Mk:={xi1yi2∣xi1yi2isamonomialoffemandxi1yi2lkisamonomialoffem-k}⋃k≤l≤m‍⋃1≤j≤tl{xi1yi1+j∣i1=l}.The definition of shift polynomialsgi1i2(x,y) is the same as above. From the definition of Mk, we have(3.13)M0:={xi1yi2∣0≤i2≤i1≤m}⋃0≤k≤m⋃1≤j≤tk{xi1yi1+j∣i1=k},Mk:={xi1yi2∣k≤i2≤i1}⋃k≤l≤m⋃1≤j≤tl{xi1yi1+j∣i1=l}.
By some rather complex calculations, we obtain that(3.14)s1=m(m+1)(m+2)3+am(m+1)(2m+1)6,s2=m(m+1)(m+2)6+a2m(m+1)(2m+1)12+am(m+1)4+am(m+1)(2m+1)6,sN=m(m-1)(m+1)6+am(m+1)(2m+1)6,
where a=(2-α-β-γ)/γ. The inequality (3.9) leads to(3.15)-2α+2β+α2-β2+αγ<0.
From Lemma 2.1 and the estimations of (3.8), it is easy to see that if(3.16)-2α+2β+α2-β2+αγ<0,
we are guaranteed to find two vectors in L that are shorter than the bound em/dim(L). The vectors are the coefficient vectors of two bivariate polynomials h1(xX,yY) and h2(xX,yY). By Howgrave-Graham's theorem, h1(x,y) and h2(x,y) have the same root (k,U) over the integers. By taking resultant of h1(x,y) and h2(x,y) with respect to y, we get g(x) with root k. We can easily extract k from g(x) with standard root finding algorithms. Therefore, we can find U from h1(x,y) or h2(x,y). This completes the description of the attack. The heuristic fact that we have in our approach is as follows.Fact 1.
The probability that the construction described above yields zero polynomial that is,g(x) is a zero polynomial is neglectable.In practice, we can assume thatg(x) is a nonzero polynomial. The following lemma shows that Fact 1 holds.Lemma 3.1.
Leth1(x,y),h2(x,y), and g(x) be defined as above. Then g(x) is a zero polynomial if and only if gcd(h1(x,y),h2(x,y))≠1.Proof.
Lemma3.1 follows from Lemma 8.2 in [9].In fact, if the polynomialsh1,h2 are random chosen, then the probability that g(x) is a zero polynomial is neglectable. From the above discussion, we get the following result.Theorem 3.2.
Lete,d be defined as above and U<Nγ. If
(3.17)-2α+2β+α2-β2+αγ<0,
then we can factor N with polynomial time.We note that whenα=1, γ=1/2, the inequality in Theorem 3.2 becomes(3.18)β2-2β+12>0,
which is the result in [4]


## 4. The Case for Small Exponente

In this section, we suppose thatα is smaller than 1. Rewriting(4.1)p=[N]-x0,q=[N]+y0,A=1-2[N],U=y0-x0,
by (3.1), we have(4.2)ed+k(A-U)≡1(modN).
Let(4.3)fN(x,y,z)=yz-ex-Ay+1.
It is easy to see that fN(x,y,z) has (d,k,U) as a root modulo N. The similar method in section 3 can be applied to three variants polynomial fN. Here the leading monomial of fN is yz and the coefficient is 1. Let ε>0 be an arbitrarily small constant. According to the size of 1/ε, we fix an integer m. For k∈{0,…,m+1}, let(4.4)tk=ak-bm,t0=max{t1,…,tm},
and c=b/a, where a=(2-α-γ)/γ,b=β/γ. Define the sets Mk of monomials as follows(4.5)M0:={xi1yi2zi3∣xi1yi2zi3isamonomialoffm}⋃1≤j≤t0{xi1zj∣0≤i1≤m-cm}⋃cm≤k≤m‍⋃1≤j≤tk{xi1ykzk+j∣1≤i1≤m-k},Mk:={xi1yi2zi3∣xi1yi2zi3isamonomialoffmandxi1yi2zi3lkisamonomialoffm-k}⋃cm≤k≤m‍⋃k≤l≤m‍⋃1≤j≤tl{xi1ylzl+j∣1≤i1≤m-k}.
We define the following shift polynomials:(4.6)gi1i2i3(x,y,z)=xi1yi2zi3lkf(x,y,z)kNm-k,
for k=0,…,m, and xi1yi2zi3∈Mk∖Mk+1.All the polynomialsgi1i2i3 have the root (d,k,U) modulo Nm. We define a lattice L by taking the coefficient vectors of gi1i2i3(xX,yY,zZ) as a basis. We can force the matrix describing L to be lower triangular. The sets Mk can be rewritten as follows:(4.7)M0={xi1yi2zi3∣0≤i1+i2≤m,and0≤i3≤i2}⋃1≤j≤t0{xi1zj∣0≤i1≤m-cm}⋃cm≤k≤m‍⋃1≤j≤tk{xi1ykzk+j∣1≤i1≤m-k},Mk={xi1yi2zi3∣k≤i1+i2≤m,andk≤i3≤i2}⋃cm≤k≤m‍⋃k≤l≤m‍⋃1≤j≤tl{xi1ylzl+j∣1≤i1≤m-k}.For example, we consider the casem=2. From the definition of Mk, we have(4.8)M0={y2z2,y2z,xyz,yz,y2,xy,x2,x,y,1},M1={y2z2,y2z,xyz,yz},M2={y2z2}.The matrix of the lattice form=2 is shown in Table 2.Table 21xyx2y2xyyzxyzy2zy2z2N2N2xN2*XN2yN2**YN2x2N2***X2N2y2N2****Y2N2xyN2*****XYN2fN******YZN2xfN*******XYZN2yfN********Y2ZN2f2*********Y2Z2N2In general, we find thatdet(L)<Nm(ω+1-n), derived from Lemmas 2.1 and 2.2, can be reduced to(4.9)Xs1Ys2Zs3<NsN,for{st=∑xi1yi2zi3∈M0it,t=1,2,3,sN=∑k=1m|Mk|.
Let |U|≤Nγ. Hence, the inequality (4.9) is equivalent to(4.10)βs1+(α+β-1)s2+γs3≤sN.
By calculation, we obtain that(4.11)s1=m424+(a-b)424a3m4+O(m3),s2=m412+a4-2a3b+2ab3-b412a3m4+O(m3),sN=m424+(a-b)424a2m4+a4-2a3b+2ab3-b412a3m4+O(m3).
Plugging these value into (4.10) and omitting the neglect terms, we get that(4.12)β(3a3+(a-b)3(3a+b))+α(2a3+2(a+b)(a-b)3)+γ(a3+(a-b)3(a2-ab+2a+2b))-(3a3+(a-b)3(7a-3b))<0,
which guarantees that we can find three vectors in L that are shorter than the bound Nm/dim(L). These vectors are the coefficient vectors of three trivariate polynomials f1(xX,yY,zZ), f2(xX,yY,zZ), and f3(xX,yY,zZ). By Howgrave-Graham’s theorem, f1(x,y,z), f2(x,y,z), and f3(x,y,z) have the root (d,k,U) over the integers. Afterward, we take the resultant of these integral polynomials with respect to the variable z and obtain two bivariate polynomials g1(x,y) and g2(x,y) with root (d,k). By taking resultant of g1(x,y) and g2(x,y) with respect to y, we get g(x) with root d. d can be easily extracted from g(x) with standard root finding algorithms. Therefore, we can find k from g1(x,y) or g2(x,y). Similarly, we can get U. By U=x0-y0 and N=([N])2+[N](y0-x0)-x0y0, then N can be factored with polynomial time. This completes the description of the attack. The heuristic fact that we have in our approach is as follows.Fact 2.
The probability that the construction described above yields zero polynomial that is,g(x) is a zero polynomial is neglectable.A similar discussion as Fact1, we have that for random choice f1(x,y,z), f2(x,y,z), and f3(x,y,z), the probability that g(x) is a zero polynomial is neglectable. Therefore, in practice, we can assume that g(x) is a nonzero polynomial.Theorem 4.1.
Lete,d be defined as above and U<Nγ. If
(4.13)β(3a3+(a-b)3(3a+b))+α(2a3+2(a+b)(a-b)3)+γ(a3+(a-b)3(a2-ab+2a+2b))-(3a3+(a-b)3(7a-3b))<0,
then we can factor N with polynomial time, where a=(2-α-γ)/γ,b=β/γ.As a special case of Theorem4.1, one can see that when 2α+γ≤1.5 and d≤N1/2, there exists an algorithm that factors N with polynomial time.


## 5. Conclusion

In this paper, we obtained our results by taking advantage of lattice reduction technique. By improving the Jochemsz and May [7] strategy of constructing a lattice basis, we throw the bad rows in the lattice and obtain an optimal lattice. Applying the method of constructing an optimal lattice to cryptanalyse short exponent RSA, we get the main results which extend those of Boneh and Durfee in [4].



---

*Source: 421348-2010-03-23.xml*