23.3 An Attack on RSA

Alice wants to send Bob a message of the form

Theansweris

or

Thepasswordforyournewaccountis.

In these cases, the message is of the form

m=B+x,  where B is fixed and |x|Y

for some integer Y. We’ll present an attack that works when the encryption exponent is small.

Suppose Bob has public RSA key (n, e)=(n, 3). Then the ciphertext is

c(B+x)3(modn).

We assume that Eve knows B, Y, and n, so she only needs to find x. She forms the polynomial

f(T)=(B+T)3c=T3+3BT2+3B2T+B3cT3+a2T2+a1T+a0(modn).

Eve is looking for |x|Y such that f(x)0(modn). In other words, she is looking for a small solution to a polynomial congruence f(T)0(modn).

Eve applies the LLL algorithm to the lattice generated by the vectors

v1=(n, 0, 0, 0), v2=(0, Yn, 0, 0), v3=(0, 0, Y2n, 0), v4=(a0, a1Y, a2Y2, Y3).

This yields a new basis b1, , b4, but we need only b1. The theorem in Subsection 23.2.2 tells us that

b123/4det(v1, , v4)1/4
(23.2)
=23/4(n3Y6)1/4=23/4n3/4Y3/2.
(23.3)

We can write

b1=c1v1++c4v4=(e0, Ye1, Y2e2, Y3e3)

with integers ci and with

e0=c1n+c4a0e1=c2n+c4a1e2=c3n+c4a2e3=c4.

It is easy to see that

eic4ai(modn), 0i2.

Form the polynomial

g(T)=e3T3+e2T2+e1T+e0.

Then, since the integer x satisfies f(x)0(modn) and since the coefficients of c4f(T) and g(T) are congruent mod n,

0c4f(x)g(x)(modn).

Assume now that

Y<27/6n1/6.
(23.4)

Then

|g(x)||e0|+|e1x|+|e2x2|+|e3x3||e0|+|e1|Y+|e2|Y2+|e3|Y3=(1, 1, 1, 1)|e0|, |e1Y|, |e2Y2|, |e3Y3|(1, 1, 1, 1)|e0|, , |e3Y3|=2b1, 

where the last inequality used the Cauchy-Schwarz inequality for dot products (that is, vwvw). Since, by (17.3) and (17.4),

b123/4n3/4Y3/2<23/4n3/427/6n1/63/2=21n, 

we obtain

|g(x)|<n.

Since g(x)0(modn), we must have g(x)=0. The zeros of g(T) may be determined numerically, and we obtain at most three candidates for x. Each of these may be tried to see if it gives the correct ciphertext. Therefore, Eve can find x.

Note that the above method replaces the problem of finding a solution to the congruence f(T)0(modn) with the exact, non-congruence, equation g(T)=0. Solving a congruence often requires factoring n, but solving exact equations can be done by numerical procedures such as Newton’s method.

In exactly the same way, we can find small solutions (if they exist) to a polynomial congruence of degree d, using a lattice of dimension d+1. Of course, d must be small enough that LLL will run in a reasonable time. Improvements to this method exist. Coppersmith ([Coppersmith2]) gave an algorithm using higher-dimensional lattices that looks for small solutions x to a monic (that is, the highest-degree coefficient equals 1) polynomial equation f(T)0(modn) of degree d. If |x|n1/d, then the algorithm runs in time polynomial in logn and d.

Example

Let

n=1927841055428697487157594258917

(which happens to be the product of the primes p=757285757575769 and q=2545724696579693, but Eve does not know this). Alice is sending the message

The answer is **,

where ** denotes a two-digit number. Therefore the message is m=B+x where B=200805000114192305180009190000 and 0x<100. Suppose Alice sends the ciphertext c(B+x)330326308498619648559464058932(modn). Eve forms the polynomial

f(T)=(B+T)3cT3+a2T2+a1T+a0(modn), 

where

a2=602415000342576915540027570000a1=1123549124004247469362171467964a0=587324114445679876954457927616.

Note that a0B3c(modn).

Eve uses LLL to find a root of f(T)(modn). She lets Y=100 and forms the vectors

v1=(n,0,0,0),v2=(0,100n,0,0),v3=(0,0,104n,0)v4=(a0,100a1,104a2,106).

The LLL algorithm produces the vector

308331465484476402v1+589837092377839611v2+316253828707108264v31012071602751202635v4=(246073430665887186108474, 577816087453534232385300, 405848565585194400880000, 1012071602751202635000000).

Eve then looks at the polynomial

g(T)=1012071602751202635T3+40584856558519440088T25778160874535342323853T+246073430665887186108474.

The roots of g(T) are computed numerically to be

42.000000000, 0.949612039±76.079608511i.

It is easily checked that g(42)=0, so the plaintext is

The answer is 42.

Of course, a brute force search through all possibilities for the two-digit number x could have been used to find the answer in this case. However, if n is taken to be a 200-digit number, then Y can have around 33 digits. A brute force search would usually not succeed in this situation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.218.215