ACISP2019: The Wiener Attack on RSA Revisited

[This post is based on a talk by Joseph Tonien at ACISP 2019 about the paper [1]]

RSA was the first public key encryption scheme to be designed. This was by Rivest, Shamir and Adleman in 1977. Since then, a whole line of research is ongoing, aiming to construct more public key encryption schemes with better performance and different properties. However, RSA is by far the most used one.

To briefly describe RSA, basically we generate two big prime numbers \(p\) and \(q\) at random to form \(N=pq\). Then we choose two integers \(e\) and \(d\) such that \(ed=1\) (mod \(\phi(N)\)), where \(\phi(N)=(p-1)(q-1)\). Then we set the public key as \((N,e)\), and the private key as \(d\).
To encrypt a message \(m\), we compute \(c = m^e\) (mod \(N\)), to decrypt, we compute \(m=c^d\) (mod \(\phi(N)\)).

RSA was widely cryptanalysed throughout the years. This has led to interesting attacks. While the hardness assumption on which RSA is based, namely the factorization remains unbroken, it turns out that, when generating “bad” parameters for the scheme, an attacker can recover the secret key in a reasonable amount time using sophisticated attacks.

One of these attacks is the Wiener attack [2] introduced in 1990, the attack targets finding \(d\) using continued fractions.

A continued fraction of a rational \(\frac{u}{v}\) is an expression of the form:


\(\frac{u}{v} = a_0+\frac{1}{a_1+\frac{1}{a_2+\frac{1}{a_3+\cdots}}}\) where \(a_0\) is an integer, and for \(i\geq 1\), \(a_i\) is a positive integer.

By truncating the coefficients, one can get an approximation of \(\frac{u}{v}\). That is, the terms :
\(c_0 = a_0\), \(c_1 = a_0+ \frac{1}{a_1}\), \(c_2 = a_0+ \frac{1}{a_1 + \frac{1}{a_2}},\ldots\), \(c_n = a_0+\frac{1}{a_1+\frac{1}{a_2+\frac{1}{a_3+\dots}}}\).

are called the convergents of \(\frac{u}{v}\). These terms give a good approximation of \(\frac{u}{v}\).

Basically, the attack takes use of this fact using the public value \(\frac{e}{N}\). That is, as \(ed – k\phi(N)=1\) for some integer \(k\). It follows that \(\frac{e}{N} \approx \frac{e}{\phi(N)} \approx \frac{k}{d}\). Therefore, one can compute the continued fraction of \(\frac{e}{N}\), hoping that one of the convergents is equal to \(\frac{k}{d}\), which can be easily checked (we are omitting the details of it).

For many years, it was a general believe that the attack works for \(d < N^{\frac{1}{4}}\). Besides, in [3], it was proven that that attack fails for \(d > N^{\frac{1}{4}}\). However no proof was provided to confirm the claim about the upper bound \(N^{\frac{1}{4}}\).

In 1999, Boneh [4] proved that the attack works for \(d < \frac{1}{3}N^{\frac{1}{4}} \). That is, if \(d\) is below this bound, there always exists a convergent term that yields \(d\). But it remained unknown what about the interval between \(\frac{1}{3}N^{\frac{1}{4}} \) and \(N^{\frac{1}{4}} \).

In [1], authors revisited this attack, where they shortened the unknown area. That is, they extended the interval in which we are sure that the attack works to become \(d \leq \frac{1}{\sqrt[4]{18}}N^{\frac{1}{4}} = \frac{1}{2.06\ldots}N^{\frac{1}{4}} \), and they provided a counter example where the attack fails for \(d=\lfloor \frac{1}{2} N^{\frac{1}{4}}\rfloor + 1 \).

Therefore, now the interval in which it is unknown whether the attack works is narrowed down to be\( \left]\frac{1}{\sqrt[4]{18}}N^{\frac{1}{4}}, \lfloor\frac{1}{2} N^{\frac{1}{4}}\rfloor + 1 \right[ \).

References:

[1]: Willy Susilo, Joseph Tonien, and Guomin Yang. The Wiener Attack on RSA Revisited: A Quest for the Exact Bound. ACISP 2019

[2]: Wiener : Cryptanalysis of short RSA secret exponents. IEEE Trans. Inf. Theor. 36, 553–558 (1990)

[3]: Steinfeld, et al. : Converse results to the wiener attack on RSA. In: Vaudenay, S. (ed.) PKC 2005. LNCS, vol. 3386, pp. 184–198. Springer, Heidelberg (2005)

[4]: Boneh: Twenty years of attacks on the RSA cryptosystem. Not. Am. Math. Soc. 46, 203–213 (1999)