Coppersmith's attack

(Learn how and when to remove this message)

Coppersmith's attack describes a class of cryptographic attacks on the public-key cryptosystem RSA based on the Coppersmith method. Particular applications of the Coppersmith method for attacking RSA include cases when the public exponent e is small or when partial knowledge of a prime factor of the secret key is available.

RSA basics

The public key in the RSA system is a tuple of integers ( N , e ) {\displaystyle (N,e)} , where N is the product of two primes p and q. The secret key is given by an integer d satisfying e d 1 ( mod ( p 1 ) ( q 1 ) ) {\displaystyle ed\equiv 1{\pmod {(p-1)(q-1)}}} ; equivalently, the secret key may be given by d p d ( mod p 1 ) {\displaystyle d_{p}\equiv d{\pmod {p-1}}} and d q d ( mod q 1 ) {\displaystyle d_{q}\equiv d{\pmod {q-1}}} if the Chinese remainder theorem is used to improve the speed of decryption, see CRT-RSA. Encryption of a message M produces the ciphertext C M e ( mod N ) {\displaystyle C\equiv M^{e}{\pmod {N}}} , which can be decrypted using d {\displaystyle d} by computing C d M ( mod N ) {\displaystyle C^{d}\equiv M{\pmod {N}}} .

Low public exponent attack

In order to reduce encryption or signature verification time, it is useful to use a small public exponent ( e {\displaystyle e} ).[1] In practice, common choices for e {\displaystyle e} are 3, 17 and 65537 ( 2 16 + 1 ) {\displaystyle (2^{16}+1)} . These values for e are Fermat primes, sometimes referred to as F 0 , F 2 {\displaystyle F_{0},F_{2}} and F 4 {\displaystyle F_{4}} respectively ( F x = 2 2 x + 1 ) {\displaystyle (F_{x}=2^{2^{x}}+1)} . They are chosen because they make the modular exponentiation operation faster. Also, having chosen such e {\displaystyle e} , it is simpler to test whether gcd ( e , p 1 ) = 1 {\displaystyle \gcd(e,p-1)=1} and gcd ( e , q 1 ) = 1 {\displaystyle \gcd(e,q-1)=1} while generating and testing the primes in step 1 of the key generation. Values of p {\displaystyle p} or q {\displaystyle q} that fail this test can be rejected there and then. (Even better: if e is prime and greater than 2, then the test p mod e 1 {\displaystyle p{\bmod {e}}\neq 1} can replace the more expensive test gcd ( p 1 , e ) = 1 {\displaystyle \gcd(p-1,e)=1} .)

If the public exponent is small and the plaintext m {\displaystyle m} is very short, then the RSA function may be easy to invert, which makes certain attacks possible. Padding schemes ensure that messages have full lengths, but additionally choosing the public exponent e = 2 16 + 1 {\displaystyle e=2^{16}+1} is recommended. When this value is used, signature verification requires 17 multiplications, as opposed to about 25 when a random e {\displaystyle e} of similar size is used. Unlike low private exponent (see Wiener's attack), attacks that apply when a small e {\displaystyle e} is used are far from a total break, which would recover the secret key d. The most powerful attacks on low public exponent RSA are based on the following theorem, which is due to Don Coppersmith.

Håstad's broadcast attack

The simplest form of Håstad's attack is presented to ease understanding.[2] The general case uses the Coppersmith method.

Suppose one sender sends the same message M {\displaystyle M} in encrypted form to a number of people P 1 ; P 2 ; ; P k {\displaystyle P_{1};P_{2};\dots ;P_{k}} , each using the same small public exponent e {\displaystyle e} , say e = 3 {\displaystyle e=3} , and different moduli N i , e {\displaystyle \left\langle N_{i},e\right\rangle } . A simple argument shows that as soon as k 3 {\displaystyle k\geq 3} ciphertexts are known, the message M {\displaystyle M} is no longer secure: Suppose Eve intercepts C 1 , C 2 {\displaystyle C_{1},C_{2}} , and C 3 {\displaystyle C_{3}} , where C i M 3 ( mod N i ) {\displaystyle C_{i}\equiv M^{3}{\pmod {N_{i}}}} . We may assume gcd ( N i , N j ) = 1 {\displaystyle \gcd(N_{i},N_{j})=1} for all i , j {\displaystyle i,j} (otherwise, it is possible to compute a factor of one of the numbers N i {\displaystyle N_{i}} by computing gcd ( N i , N j ) {\displaystyle \gcd(N_{i},N_{j})} .) By the Chinese remainder theorem, she may compute C Z N 1 N 2 N 3 {\displaystyle C\in \mathbb {Z} _{N_{1}N_{2}N_{3}}^{*}} such that C C i ( mod N i ) {\displaystyle C\equiv C_{i}{\pmod {N_{i}}}} . Then C M 3 ( mod N 1 N 2 N 3 ) {\displaystyle C\equiv M^{3}{\pmod {N_{1}N_{2}N_{3}}}} ; however, since M < N i {\displaystyle M<N_{i}} for all i {\displaystyle i} , we have M 3 < N 1 N 2 N 3 {\displaystyle M^{3}<N_{1}N_{2}N_{3}} . Thus C = M 3 {\displaystyle C=M^{3}} holds over the integers, and Eve can compute the cube root of C {\displaystyle C} to obtain M {\displaystyle M} .

For larger values of e {\displaystyle e} , more ciphertexts are needed, particularly, e {\displaystyle e} ciphertexts are sufficient.

Generalizations

Håstad also showed that applying a linear padding to M {\displaystyle M} prior to encryption does not protect against this attack. Assume the attacker learns that C i = f i ( M ) e {\displaystyle C_{i}=f_{i}(M)^{e}} for 1 i k {\displaystyle 1\leq i\leq k} and some linear function f i {\displaystyle f_{i}} , i.e., Bob applies a pad to the message M {\displaystyle M} prior to encrypting it so that the recipients receive slightly different messages. For instance, if M {\displaystyle M} is m {\displaystyle m} bits long, Bob might encrypt M i = i 2 m + M {\displaystyle M_{i}=i2^{m}+M} and send this to the i {\displaystyle i} -th recipient.

If a large enough group of people is involved, the attacker can recover the plaintext M i {\displaystyle M_{i}} from all the ciphertext with similar methods. In more generality, Håstad proved that a system of univariate equations modulo relatively prime composites, such as applying any fixed polynomial g i ( M ) 0 ( mod N i ) {\displaystyle g_{i}(M)\equiv 0{\pmod {N_{i}}}} , could be solved if sufficiently many equations are provided. This attack suggests that randomized padding should be used in RSA encryption.

Franklin–Reiter related-message attack

Franklin and Reiter identified an attack against RSA when multiple related messages are encrypted: If two messages differ only by a known fixed difference between the two messages and are RSA-encrypted under the same RSA modulus N {\displaystyle N} , then it is possible to recover both of them. The attack was originally described with public exponent e = 3 {\displaystyle e=3} , but it works more generally (with increasing cost as e {\displaystyle e} grows).

Let N ; e i {\displaystyle \left\langle N;e_{i}\right\rangle } be Alice's public key. Suppose M 1 ; M 2 Z N {\displaystyle M_{1};M_{2}\in \mathbb {Z} _{N}} are two distinct messages satisfying M 1 f ( M 2 ) ( mod N ) {\displaystyle M_{1}\equiv f(M_{2}){\pmod {N}}} for some publicly known polynomial f Z N [ x ] {\displaystyle f\in \mathbb {Z} _{N}[x]} . To send M 1 {\displaystyle M_{1}} and M 2 {\displaystyle M_{2}} to Alice, Bob may naively encrypt the messages and transmit the resulting ciphertexts C 1 ; C 2 {\displaystyle C_{1};C_{2}} . Eve can easily recover M 1 ; M 2 {\displaystyle M_{1};M_{2}} , given C 1 ; C 2 {\displaystyle C_{1};C_{2}} , by using the following theorem:

Coppersmith’s short-pad attack

Like Håstad’s and Franklin–Reiter’s attacks, this attack exploits a weakness of RSA with public exponent e = 3 {\displaystyle e=3} . Coppersmith showed that if randomized padding suggested by Håstad is used improperly, then RSA encryption is not secure.

Suppose Bob sends a message M {\displaystyle M} to Alice using a small random padding before encrypting it. An attacker, Eve, intercepts the ciphertext and prevents it from reaching its destination. Bob decides to resend M {\displaystyle M} to Alice because Alice did not respond to his message. He randomly pads M {\displaystyle M} again and transmits the resulting ciphertext. Eve now has two ciphertexts corresponding to two encryptions of the same message using two different random pads.

Even though Eve does not know the random pad being used, she still can recover the message M {\displaystyle M} by using the following theorem, if the random padding is too short.

See also

References

  1. ^ Boneh, Dan (1999). "Twenty years of attacks on the RSA cryptosystem". Notices of the American Mathematical Society. 46 (2): 203–213.
  2. ^ Glenn Durfee, Cryptanalysis of RSA Using Algebraic and Lattice Methods.