1. Introduction
The RSA cryptosystem is the most widely used public key cryptosystem, invented by three mathematicians, Rivest, Shamir, and Adleman [
1] and since then has been extensively used for many applications in the government as well as commercial domain, which include e-banking, secure telephone, smart cards, and communications in different types of networks [
2].
RSA key generation involves a random selection of two distinct large prime numbers such that their product is represented as and called an RSA modulus. The Euler totient function is computed as . Additionally, choose an integer such that and compute short decryption exponent d such that the relation is satisfied. Then, are the public pair and are private key tuple.
The encryption function is computed by choosing a message and computing the ciphertext , while the plaintext can be recovered by computing the decryption exponent from equation . The primes p and q in most cases are considered to have same bit-length.
In simpler terms, an RSA cryptosystem involves three processes of key generation, encryption, and decryption algorithms as presented in Algorithms 1–3 below:
Algorithm 1 RSA key generation |
- 1:
Initialization: Input the size n and . - 2:
Choose two random and distinct strong primes . - 3:
for each pair of the form do - 4:
- 5:
- 6:
end for - 7:
Choose a random integer e such that and = 1. - 8:
ifd is an integer then - 9:
. - 10:
end if - 11:
return the public key pair and the private key pair .
|
Algorithm 2 RSA encryption |
- 1:
Initialization: Input the public key pair and the plaintext M. - 2:
Represents the plaintext message M as integer such that and . - 3:
for each triplet of the form do - 4:
- 5:
end for - 6:
return the ciphertext C.
|
Algorithm 3 RSA decryption |
- 1:
Initialization: Input the private key pair and the ciphertext C. - 2:
for each triplet of the form do - 3:
- 4:
end for - 5:
return the message M.
|
The security of an RSA cryptosystem depends on the difficulty of solving the integer factorization problem, the failure of an adversary to compute the secret key
d from RSA key equation
, where only the public key
e is given as outlined in Algorithm 1 and the difficulty of solving the
-root problem of
as outlined in Algorithm 2. The problem of computing
d from
is equivalent to the problem of factoring RSA modulus
N into its nontrivial prime factors of
p and
q, as proven by Reference [
3]. It is therefore recommended for RSA users to generate primes
p and
q in such a way that the problem of factoring
is computationally infeasible for an adversary. Choosing
p and
q as strong primes has been recommended as a way of maximizing the difficulty of factoring RSA modulus
N.
In an RSA cryptosystem, there are public key pairs
and private key tuples
. Once the private key
d is known, it can lead to the total break of RSA. It is often tempting to use a small decryption exponent so as to speed up computation in RSA decryption and signature verification. However, this poses a great security challenge to the system. A very small decryption exponent can be broken by a trivial brute force exhaustive search to find the correct decryption exponent. For instance, all private exponents
can be recovered easily, but it is computationally infeasible to recover all private exponents
by brute force attack [
4].
The first attack on small decryption exponent was reported by Wiener in 1990. He showed that RSA is insecure if the small decryption exponent is
using the continued fractions method to recover
d from the convergents of the continued fractions expansion of
, [
5]. Since then, many attacks on short decryption exponents emerged, which improved the bound. Boneh and Durfee (1999) proposed an attack on the small decryption exponent using the Coppersmith lattice-based technique, in which they heuristically showed that RSA in insecure if
, as reported by Reference [
6].
In another development, B. De Weger (2002) also used the primes difference method to carry out an attack on RSA modulus
, where he proved that if
, then the RSA cryptosystem is considered to be insecure where primes
p and
q have the same bit-length, which is an improvement on Wiener’s bound as reported by Reference [
7]. In addition, Maitra and Sarkar (2008) improved the work of Reference [
7] using the prime difference method of
and showed that RSA is not secure if
, as reported by Reference [
8].
Furthermore, Chen’s et al. (2009) have generalized the work of Reference [
7], where they proposed an attack using the generalization method, in which they proved that RSA modulus
can be broken if
and
, where the ratio of two primes
is very near to the ratio
, where
,
a, and
b are small positive integers less than
, then the RSA modulus can be factored from the convergents of the continued fraction expansion of
. Substituting
gave the approximation of
as reported by [
7]. Also, taking
and
gave approximation of
as reported by Reference [
8]. In their experiment result, they used the value of
to justify their theorem, as reported by Reference [
9].
Nitaj (2013) improved Wiener’s bound to
, as reported by Reference [
10]. Asbullah (2015) also improved Wiener’s bound to
, as reported [
11].
This paper reports the use of the small prime difference method to factor the RSA modulus
N and its relation to further extend the bound of weak decryption exponents. Given public key pair
, we exploited RSA key equation
and broke the instances of RSA by factoring the modulus
N into its nontrivial prime factors
p and
q. We also reported four cryptanalytic attacks on factoring
t RSA moduli using a system of equations where, in one instance, the moduli
shared a common decryption exponent
d and, in another scenario, every pair
had its own unique decryption exponent
. The method uses
such that if the ratio of
is close to the ratio of
, where
a and
b are small positive integers and
, then private key
can be efficiently recovered from the convergents of the continued fraction expansion of
. Our bound is considered to be an improved bound of that of References [
5,
9,
11]. This paper also presents an experimental result which shows that taking
, we can recover primes
p and
q if the private key
. This is an improvement of the result of Reference [
9], as they did not give an experiment result of
.
The second part of the paper presents
t instances of factoring RSA moduli
for
by transforming generalized key equations of the form
,
,
, and
for unknown parameters
, and
into simultaneous Diophantine problem and applying the lattice basis reduction and
methods to find the values of
d,
,
, and
k. We formulated a quadratic equation which enabled us to find
t prime factors
and
and finally factorize
t moduli
in polynomial time. We have found decryption exponents bounds that are greater than those of References [
12,
13].
The rest of the paper is organized as follows. In
Section 2, we present a review of some preliminary results on continued fractions and state some theorems that are related to our work.
Section 3 presents our proposed findings and discussion on the results. We give experimental results to illustrate our theorems, which show how an incorrect choice of
d can lead to the factorization of RSA modulus
in polynomial time. Finally, in
Section 4, we conclude the paper.
2. Preliminaries and Methods
In this section, we state some basics on continued fraction, the lattice basis reduction technique, simultaneous Diophantine approximations, and theorems related to our work.
Definition 1 (Continued fractions)
. For any positive , define and for , do , until . Then, x can be expanded as continued fraction in following form, This expression is often used in the form . Any rational number can be expressed as a finite continued fraction . The convergents of x are the fractions denoted by for . We note that if is a rational number, then the continued fraction expansion of x is finite with total number of convergents being polynomial in .
Definition 2. Let where V is a vector space subset of . The set of vectors are said to be linearly dependent if there exist , which are not all zero and such that: Otherwise, they are said to be linearly independent.
Definition 3. (Lenstra et al. 1982) Let n be a positive integer. A subset of an n-dimensional real vector space is called a lattice and if there exists a basis on such that we have the following relation . In this situation, we say that are the basis for or that they span
Definition 4. (Nitaj, 2013) (LLL Reduction) Let be a basis for a lattice and suppose be the associated Gram–Schmidt orthogonal basis. Let: The basis is said to be LLL reduced if it satisfies the following two conditions:
Theorem 1. (Legendre’s Theorem). Let α be a positive real number. If the rational numbers such that and:then is one of the convergents of the continued fraction expansion α. Theorem 2. (Wang et al., 2016). If are convergents of the simple continued fraction , then the numerators and denominators of these convergents satisfy the following recursive relations:for . Theorem 3. (Wiener, 1990). Let be an RSA modulus with . Let be a public exponent and d be the corresponding private key. If , then one can factor N in polynomial time.
Theorem 4. (B. de Weger, 2002). Let be an RSA modulus with such that for , and . Let e and d be public and private keys respectively such that with and . If , then the convergents can be found from the continued fraction of , which led to the factorization of N.
Theorem 5. (Maitra-Sarkar, 2008). Let be an RSA modulus satistying . Suppose that with and . Then N can be factored in polynomial time if from the convergents of the continued fraction expansion of .
Theorem 6. (Chen et al., 2009). Let p and q be RSA primes satisfying . Let . If is close to such that , then the secret key can be discovered from the convergents of .
Theorem 7. (Blomer-May, 2004). Let be an RSA public pair with modulus and the prime difference . Suppose that the public exponent satisfies with and for . Then, N can be factored in polynomial time.
Theorem 8. (Lenstra et al., 1982). Let be a lattice basis of dimension n having a basis The algorithm produces a reduced basis satisfying the following condition:for all We will use the following Theorem 9 in our proofs of Theorems 14–17.
Theorem 9. (Simultaneous Diophantine Approximations) (Nitaj et al., 2014). Given any rational numbers of the form and , there is a polynomial time algorithm to compute integers and a positive integer q such that: Theorem 10. (Nitaj et al. 2014). Let for be k RSA moduli. Let and , be k public exponents. Define . If there exist an integer and k integers and such that for , then one can factor k RSA moduli in polynomial time.
Theorem 11. (Nitaj et al., 2014). Let , for be k RSA moduli where p and p are balanced primes. Let , , be k public exponents with . Define . If there exist an integer and k integers and such that for , then one can factor the k RSA moduli in polynomial time.
Theorem 12. (Asbullah, 2015). Let with . Let and d satisfy . If , then is a convergent of the continued fraction .
3. The Proposed Findings and Discussion
In this section, we present our findings. The first part reported a short secret exponent attack on RSA modulus , where p and q are prime numbers of the same bit-length. We show that if , then one can find from the convergents of the continued fraction expansion of which leads to the factorization of RSA modulus N in polynomial time. In the second part of the paper, we presented four cryptanalytic attacks using a generalized key equation of the shape , , , and for unknown integers , and . We showed that t RSA moduli can be simultaneously factored in polynomial time where .
3.1. A Short Decryption Exponent Attack Using
In this section, we present two lemmas and a theorem with numerical examples.
Lemma 1. Let p and q be prime numbers, where and . If a and b are small positive integers such that is close to for and , then .
Proof of Lemma 1. Let
, then we get,
Adding
to both sides we have,
Then . ☐
Lemma 2. Let p and q be prime numbers where and . If,then, Proof of Lemma 2. Since
, we get,
☐
Theorem 13. Let p and q be prime numbers, where and . Given the pair for as a public key pair and (d,p,q) as a private key tuple, let . If is close to such that the relation holds and , then can be calculated efficiently from the convergent of the continued fraction expansion of for and are positive integers less than .
Proof of Theorem 13. Since
and
, then from Lemma 2 we have,
Using RSA key equation
, for some
, this gives us,
Taking
as approximation of
, this becomes,
Now, assuming that
,
and
, where
a and
b are small positive integers, plugging the conditions into above inequality (Equation (
1)), we get,
Suppose that
, then,
This shows that Theorem 13 produces as the convergent of the continued fraction expansion of . This terminates the proof. ☐
This is an improvement on the work of Reference [
9], whose
. Also taking the value of
, we have our decryption exponent
, which is also an improvement on the results of References [
5,
11] whose decryption exponents were
and
, respectively.
From
Table 1 one can observe that our bound is an improvement of the abovementioned bounds.
Example 1. In this example, we illustrate how to factor the RSA modulus for the case . Let,and , , . Taking the continued fraction expansion of , we get,and their corresponding convergents are as follows, and computing, Finally, solving the quadratic equation
leads to the factorization of
N. This reveals the factors of
N as
and
Taking the value of
, this shows that our bound increases to
, that is,
. This shows that our private key is greater than the bounds of References [
5,
11], i.e.,
(bound of Reference [
5] ) and
(bound of Reference [
11]). This is an improvement on bounds stated in
Table 1.
3.2. System of Equations Using as Approximation of
In this section, we present four cryptanalytic attacks on t RSA moduli using a system of equations of the form , , , and for , in which we successfully factor t RSA moduli in polynomial time for unknown positive integers d, , , , and k for .
3.2.1. The Attack on t RSA Moduli Satisfying
Taking , let , . The attack works for t instances when there exist an integer d and t integers satisfying equation . We show that prime factors and of t RSA moduli for can be found efficiently for N and In this case, the RSA instances shared common decryption exponent d.
Theorem 14. Let be t RSA moduli for and let be a public key pair and be a private key pair such that and the relation is satisfied. Let also N ; if there exist positive integers such that equation holds, then prime factors of t RSA moduli can be successfully recovered in polynomial time.
Proof of Theorem 14. For
, and let
,
be
t moduli. Let
N and suppose that
. Then equation
can be rewritten as,
Let
and suppose that
are positive integers and from Theorem 13, it was shown that,
Hence, to show the existence of integer
d and
t integers
we let
, with
. Then, we have,
Following Theorem 9, we have
for
, then, we get
. It follows that if
, then
for
. Finally,
This clearly satisfies the conditions of Theorem 9, and we proceed to reveal the private key
d and
t integers
for
. Next, from equation
we compute,
Finally, by finding the roots of the quadratic equation , the prime factors and can be revealed, which lead to the factorization of t RSA moduli for in polynomial time. ☐
Consider the lattice
spanned by the matrix,
Taking suitable small positive integers a and b, the matrix M can be used in computing the reduced basis after we apply the LLL algorithm.
Example 2. In what follows, we give an illustration of how Theorem 14 works on three RSA moduli and their corresponding public exponents, By using , and since , we will have from Algorithm 4 and
Algorithm 4 Theorem 14 |
- 1:
Initialization: The public key tuple satisfying Theorem 14. - 2:
Choose a, b and t to be suitable small positive integers and for . - 3:
foranydo - 4:
- 5:
for . - 6:
endfor - 7:
Consider the lattice spanned by the matrix M as stated above. - 8:
Applying the LLL algorithm to , we obtain the reduced basis matrix K. - 9:
foranydo - 10:
- 11:
. - 12:
endfor - 13:
Produce d, from Q - 14:
foreach triplet do - 15:
- 16:
. - 17:
endfor - 18:
Solve the quadratic equation - 19:
return the prime factors .
|
Applying Theorem 9 and using Algorithm 4 for
, we compute,
Consider the lattice
spanned by the matrix,
Therefore, by applying the LLL algorithm to
, we obtain the reduced basis with the following matrix,
Next, from Algorithm 4 we compute
,
From the first row of matrix
Q, we obtain
, and
as follows,
Using Algorithm 4, we now compute
for
.
Next, from Algorithm 4 we proceed to compute
for
.
Finally, solving the quadratic equation
for
yields
,
, and
, which lead to the factorization of three RSA moduli
That is,
From our result, one can observe that we get
, which is larger than Blömer–May’s bound
, as reported in Reference [
12]. Our
is also larger than Nitaj et al.’s bound
, as reported in Reference [
13].
3.2.2. The Attack on t RSA Moduli Satisfying
In this section, we consider a second case in which t RSA moduli satisfy t equations of the form for unknown positive integers and k for . In this case, every pair of the RSA instances has its own unique decryption exponent .
Theorem 15. Let be t RSA moduli for and let be a public key pair and be a private key pair with and the given relation is satisfied. Let e be t public exponents; if there exist t integers such that equation holds, then t prime factors of RSA moduli can be successfully recovered in polynomial time.
Proof of Theorem 15. For
and
, be
t RSA moduli. Let
be
t public exponents for
and suppose that
. Then, the equation
can be rewritten as,
Let
and
,
be positive integers and from Theorem 13, it was shown that,
Additionally, suppose that
, then we have,
We now proceed to show the existence of integer k and t integers
. Let
and
. Then, we get,
Following Theorem 9, we have
for
, then we get
. It follows that if
and following Theorem 9, we have
for
. Finally,
This clearly satisfies the conditions of Theorem 9, and we proceed to reveal
t integers of the private key
and integer
k for
. Next, from equation
we compute,
Finally, by finding the roots of the quadratic equation , the prime factors and can be found, which lead to the factorization of t RSA moduli for ☐
Consider the lattice
spanned by the matrix,
Taking suitable small positive integers a and b, the matrix M can be used in computing the reduced basis after we apply the LLL algorithm
Example 3. In what follows, we give a numerical example to illustrate how our attack of Theorem 15 works on three RSA Moduli. We consider the following three RSA moduli and their corresponding public exponents, Observe that,
with
with
. By using
,
and since
, we will have from Algorithm 5
and
.
Applying Theorem 9 and using Algorithm 5, we compute,
Algorithm 5 Theorem 15 |
- 1:
Initialization: The public key tuple satisfying Theorem 15. - 2:
Choose a, b and t to be suitable small positive integers and for . - 3:
foranydo - 4:
- 5:
- 6:
for . - 7:
endfor - 8:
Consider the lattice spanned by the matrix M as stated above. - 9:
Applying the LLL algorithm to , we obtain the reduced basis matrix K. - 10:
foranydo - 11:
- 12:
. - 13:
endfor - 14:
Produce , k from Q - 15:
foreach triplet do - 16:
- 17:
. - 18:
endfor - 19:
Solve the quadratic equation - 20:
return the prime factors .
|
Consider the lattice
spanned by the matrix,
Therefore, by applying the LLL algorithm to
, we obtain the reduced basis with the following matrix,
Next, from Algorithm 5, we compute
,
From the second row of matrix
Q, we obtain
, and
as follows,
Using Algorithm 5, we compute
for
. That is,
Next, from Algorithm 5 we proceed to compute
for
.
Finally, solving the quadratic equation
for
yields
,
, and
which lead to the factorization of three RSA moduli
That is,
From our result, one can observe that we get
, which is larger than Blömer–May’s bound
, as reported in Reference [
12].
3.2.3. The Attack on t RSA Moduli Satisfying
In this section, we consider another case in which t RSA moduli satisfies t equations of the form for unknown positive integers , k, and for .
For , let , for . The attack works for t instances if there exist an integer d and t integers such that holds. We show that prime factors and of t RSA moduli for can be found efficiently for N and , and for all for unknown positive integers , and In this case, the RSA instances shared a common decryption exponent d.
Theorem 16. Let be RSA moduli for and let the pair be public keys and bea private key with and the given relation is satisfied. Let N for . If there exist integers such that equation holds, then the prime factors of t RSA moduli can be successfully recovered in polynomial time.
Proof of Theorem 16. For
, and let
,
be
t RSA moduli. Let
N and suppose that
. Then equation
can be rewritten as,
Taking
and suppose that
,
are positive integers and from Theorem 13, it was shown that,
Plugging into Equation (
5) yields,
Hence, to show the existence of integer
d and
t integers
, we let
, with
. Then, we have:
Following Theorem 9, we have
for
, then we get
. It follows that if
, then
for
. Finally,
This also satisfies the conditions of Theorem 9, and we next proceed to reveal the private key
d and
t integers
for
. Next, from equation
we compute,
Finally, by finding the roots of the quadratic equation , prime factors and can be revealed, which lead to the factorization of t RSA moduli for in polynomial time. ☐
Consider the lattice
spanned by the matrix,
Taking suitable small positive integers a and b, the matrix M can be used in computing the reduced basis after we apply the LLL algorithm.
Example 4. In what follows, we give a numerical example to illustrate how our attack of Theorem 16 works on t RSA Moduli. We consider the following three RSA moduli and their corresponding public exponents, By using
,
and since
, we will have from Algorithm 6
and
Applying Theorem 9 and Algorithm 6 for
we compute,
Algorithm 6 Theorem 16 |
- 1:
Initialization: The public key tuple satisfying Theorem 16. - 2:
Choose a, b and t to be suitable small positive integers and for - 3:
foranydo - 4:
- 5:
- 6:
endfor - 7:
Consider the lattice spanned by the matrix M as stated above. - 8:
Applying the LLL algorithm to , we obtain the reduced basis matrix K. - 9:
foranydo - 10:
- 11:
- 12:
endfor - 13:
Produce d, Q - 14:
foreach triplet do - 15:
- 16:
- 17:
endfor - 18:
Solve the quadratic equation - 19:
return the prime factors
|
Consider the lattice
spanned by the matrix
Therefore, by applying the LLL algorithm to
, we obtain the reduced basis with the following matrix,
Next, from Algorithm 6, we compute
,
From the first row of matrix
Q, one can observe that we obtain
, and
as follows,
Using Algorithm 6, we compute
for
where
are,
Next, from Algorithm 6, we compute
for
Finally, solving the quadratic equation
for
yields
,
, and
which lead to the factorization of three RSA moduli
That is,
From our result, one can observe that we get
, which is larger than Blömer–May’s bound
, as reported in Reference [
12]. Our
is also larger than Nitaj et al.’s bound
, as reported in Reference [
13].
3.2.4. The Attack on t RSA Moduli Satisfying
In this section, we present another case in which t RSA moduli satisfies t equations of the form for unknown positive integers , k, and for , which can be simultaneously factored in polynomial time. In this case, every pair of the RSA instances has its own unique decryption exponent .
Theorem 17. Let be t RSA moduli for and let be a public key pair and be a private key pair with condition and the given relation is satisfied. Let be t public exponents. If there exist positive integers , for all such that the equation holds, then t prime factors of RSA moduli can be found successfully in polynomial time.
Proof of Theorem 17 For
and suppose
to be
t RSA moduli for
. Suppose that
are
t public exponents and suppose that
. Then, equation
can be rewritten as,
Let
for
, and
,
,
be positive integers and
, e
, then we have,
We now proceed to show the existence of integer
k and
t integers
. Let
and
. Then, we get,
Following Theorem 9, we have
for
, then we get
. It follows that if
, then
for
. Finally,
This satisfies the conditions of Theorem 9 and we proceed to find the values of
and
k for
. Next, from the equation
we compute,
Finally, by finding the roots of the quadratic equation , the prime factors and can be found, which lead to the factorization of t RSA moduli for . ☐
Consider the lattice
spanned by the matrix,
Taking suitable small positive integers a and b, the matrix M can be used in computing the reduced basis after we apply the LLL algorithm.
Algorithm 7 Theorem 17 |
- 1:
Initialization: The public key tuple satisfying Theorem 17. - 2:
Choose a, b and t to be suitable small positive integers and for . - 3:
foranydo - 4:
- 5:
- 6:
for . - 7:
endfor - 8:
Consider the lattice spanned by the matrix M as stated above. - 9:
Applying the LLL algorithm to , we obtain the reduced basis matrix K. - 10:
foranydo - 11:
- 12:
. - 13:
endfor - 14:
Produce , k from Q - 15:
foreach triplet do - 16:
- 17:
. - 18:
endfor - 19:
Solve the quadratic equation - 20:
return the prime factors .
|
Example 5. In what follows, we give a numerical example to illustrate how our attack of Theorem 17 works on t RSA Moduli. We consider the following three RSA moduli and their corresponding public exponents, Observe that,
with
for
. By using
,
and since
, we will have from Algorithm 7
and
.
Applying Theorem 9 and using Algorithm 7, we compute,
Consider the lattice
spanned by the matrix,
Therefore, by applying the LLL algorithm to
, we obtain the reduced basis with the following matrix,
Next, from Algorithm 7 we compute
,
From the first row of matrix
J, one can observe that we obtain
, and
as follows,
Using Algorithm 7, we compute
for
, where
are,
Next, from Algorithm 7 we compute
for
.
Finally, solving the quadratic equation
for
yields
,
, and
, which lead to the factorization of three RSA moduli
That is,
From our result, one can observe that we get
, which is larger than Blömer–May’s bound
, as reported in Reference [
12].
4. Conclusions
In this paper, it has been shown that our proposed cryptanalytic attacks on RSA modulus using the prime difference method can be used efficiently. The use of as a good approximation of is necessary as we have discovered a short decryption exponent bound as a right candidate from the convergents of the continued fraction expansion of that led to the successful factorization of the RSA modulus in polynomial time. This paper also reported instances of factoring t RSA moduli by transforming generalized key equations , , , and , where into a simultaneous Diophantine approximations problem and later applied the LLL and lattice basis reduction methods, which produced a reduced basis that yielded the values of , and . Finally, we computed and solved a system of quadratic equation for , which produce the roots , , and as prime factors of t RSA moduli In all the four attacks presented on t instances of RSA moduli , we have improved the short secret exponent bound.