Coppersmith's Attack
   HOME

TheInfoList



OR:

Coppersmith's attack describes a class of
cryptographic attack Cryptanalysis (from the Greek ''kryptós'', "hidden", and ''analýein'', "to analyze") refers to the process of analyzing information systems in order to understand hidden aspects of the systems. Cryptanalysis is used to breach cryptographic sec ...
s on the
public-key cryptosystem Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic alg ...
RSA based on the
Coppersmith method The Coppersmith method, proposed by Don Coppersmith, is a method to find small integer zeroes of univariate or bivariate polynomials modulo a given integer. The method uses the Lenstra–Lenstra–Lovász lattice basis reduction algorithm (LLL) t ...
. 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
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
s (N, e), where ''N'' is the product of two primes ''p'' and ''q''. The secret key is given by an integer ''d'' satisfying ed \equiv 1 \pmod; equivalently, the secret key may be given by d_p \equiv d \pmod and d_q \equiv d \pmod if the Chinese remainder theorem is used to improve the speed of decryption, see CRT-RSA. Encryption of a
message A message is a discrete unit of communication intended by the source for consumption by some recipient or group of recipients. A message may be delivered by various means, including courier, telegraphy, carrier pigeon and electronic bus. A ...
''M'' produces the
ciphertext In cryptography, ciphertext or cyphertext is the result of encryption performed on plaintext using an algorithm, called a cipher. Ciphertext is also known as encrypted or encoded information because it contains a form of the original plaintext ...
C \equiv M^e \pmod, which can be decrypted using d by computing C^d \equiv M \pmod.


Low public exponent attack

In order to reduce
encryption In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can de ...
or
signature A signature (; from la, signare, "to sign") is a handwritten (and often stylized) depiction of someone's name, nickname, or even a simple "X" or other mark that a person writes on documents as a proof of identity and intent. The writer of a ...
verification Verify or verification may refer to: General * Verification and validation, in engineering or quality management systems, is the act of reviewing, inspecting or testing, in order to establish and document that a product, service or system meets ...
time, it is useful to use a small public exponent (e). In practice, common choices for e are 3, 17 and
65537 65537 is the integer after 65536 and before 65538. In mathematics 65537 is the largest known prime number of the form 2^ +1 (n = 4). Therefore, a regular polygon with 65537 sides is constructible with compass and unmarked straightedge. Johann ...
(2^ + 1). These values for ''e'' are
Fermat primes In mathematics, a Fermat number, named after Pierre de Fermat, who first studied them, is a positive integer of the form :F_ = 2^ + 1, where ''n'' is a non-negative integer. The first few Fermat numbers are: : 3, 5, 17, 257, 65537, 4294967 ...
, sometimes referred to as F_0, F_2 and F_4 respectively (F_x = 2^ + 1). They are chosen because they make the
modular exponentiation Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie-Hellman Key Exchange and RSA public/private keys. Modul ...
operation faster. Also, having chosen such e, it is simpler to test whether \gcd(e, p - 1) = 1 and \gcd(e, q - 1) = 1 while generating and testing the primes in step 1 of the
key generation Key generation is the process of generating keys in cryptography. A key is used to encrypt and decrypt whatever data is being encrypted/decrypted. A device or program used to generate keys is called a key generator or keygen. Generation in crypt ...
. Values of p or 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 \bmod e \ne 1 can replace the more expensive test \gcd(p - 1, e) = 1.) If the public exponent is small and the
plaintext In cryptography, plaintext usually means unencrypted information pending input into cryptographic algorithms, usually encryption algorithms. This usually refers to data that is transmitted or stored unencrypted. Overview With the advent of com ...
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 public exponent e = 2^ + 1 is recommended. When this value is used, signature verification requires 17 multiplications, as opposed to about 25 when a random e of similar size is used. Unlike low private exponent (see Wiener's attack), attacks that apply when a small e is used are far from a total
break Break or Breaks or The Break may refer to: Time off from duties * Recess (break), time in which a group of people is temporarily dismissed from its duties * Break (work), time off during a shift/recess ** Coffee break, a short mid-morning res ...
, 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 Don Coppersmith (born 1950) is a cryptographer and mathematician. He was involved in the design of the Data Encryption Standard block cipher at IBM, particularly the design of the S-boxes, strengthening them against differential cryptanalysi ...
.


Coppersmith method

; Theorem 1 (Coppersmith)D. Boneh
Twenty years of attacks on the RSA cryptosystem
: Let ''N'' be an
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
and f \in /math> be a
monic polynomial In algebra, a monic polynomial is a single-variable polynomial (that is, a univariate polynomial) in which the leading coefficient (the nonzero coefficient of highest degree) is equal to 1. Therefore, a monic polynomial has the form: :x^n+c_x^+\c ...
of degree d over the integers. Set X = N^ for \frac > \epsilon > 0. Then, given \left \langle N, f \right \rangle , attacker (Eve) can efficiently find all integers x_0 < X satisfying f(x_0) \equiv 0 \pmod. The
running time In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by t ...
is dominated by the time it takes to run the
LLL algorithm LLL may refer to: Businesses and organisations *L3 Technologies, an American defense contractor formerly with the NYSE stock symbol LLL *La Leche League, an organization that promotes breastfeeding Education * LL.L (''Legum Licentiatus''), a ...
on a
lattice Lattice may refer to: Arts and design * Latticework, an ornamental criss-crossed framework, an arrangement of crossing laths or other thin strips of material * Lattice (music), an organized grid model of pitch ratios * Lattice (pastry), an orna ...
of
dimension In physics and mathematics, the dimension of a mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any point within it. Thus, a line has a dimension of one (1D) because only one coor ...
O(w) with w = \min\left\. This theorem states the existence of an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
that can efficiently find all
roots A root is the part of a plant, generally underground, that anchors the plant body, and absorbs and stores water and nutrients. Root or roots may also refer to: Art, entertainment, and media * ''The Root'' (magazine), an online magazine focusing ...
of f modulo N that are smaller than X = N^ . As X gets smaller, the algorithm's runtime decreases. This theorem's strength is the ability to find all small roots of polynomials modulo a composite N.


Håstad's broadcast attack

The simplest form of Håstad's attackGlenn Durfee
Cryptanalysis of RSA Using Algebraic and Lattice Methods
is presented to ease understanding. The general case uses the Coppersmith method. Suppose one sender sends the same message M in encrypted form to a number of people P_1;P_2;\dots ;P_k , each using the same small public exponent e, say e=3, and different moduli \left\langle N_i, e \right\rangle . A simple argument shows that as soon as k \ge 3 ciphertexts are known, the message M is no longer secure: Suppose Eve intercepts C_1, C_2, and C_3, where C_i \equiv M^3 \pmod. We may assume \gcd(N_i, N_j) = 1 for all i, j (otherwise, it is possible to compute a
factor Factor, a Latin word meaning "who/which acts", may refer to: Commerce * Factor (agent), a person who acts for, notably a mercantile and colonial agent * Factor (Scotland), a person or firm managing a Scottish estate * Factors of production, suc ...
of one of the numbers N_i by computing \gcd(N_i, N_j).) By the Chinese remainder theorem, she may compute C \in \mathbb^*_ such that C \equiv C_i \pmod. Then C \equiv M^3\pmod; however, since M < N_i for all i, we have M^3 < N_1N_2N_3. Thus C = M^3 holds over the integers, and Eve can compute the cube root of C to obtain M. For larger values of e, more ciphertexts are needed, particularly, e ciphertexts are sufficient.


Generalizations

Håstad also showed that applying a
linear Linearity is the property of a mathematical relationship ('' function'') that can be graphically represented as a straight line. Linearity is closely related to '' proportionality''. Examples in physics include rectilinear motion, the linear ...
padding Padding is thin cushioned material sometimes added to clothes. Padding may also be referred to as batting when used as a layer in lining quilts or as a packaging or stuffing material. When padding is used in clothes, it is often done in an attempt ...
to M prior to encryption does not protect against this attack. Assume the attacker learns that C_i = f_i(M)^e for 1 \leq i \leq k and some linear function f_i, i.e., Bob applies a pad to the
message A message is a discrete unit of communication intended by the source for consumption by some recipient or group of recipients. A message may be delivered by various means, including courier, telegraphy, carrier pigeon and electronic bus. A ...
M prior to
encrypt In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can deci ...
ing it so that the recipients receive slightly different messages. For instance, if M is m bits long, Bob might
encrypt In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can deci ...
M_i = i2^m + M and send this to the i-th recipient. If a large enough group of people is involved, the attacker can recover the
plaintext In cryptography, plaintext usually means unencrypted information pending input into cryptographic algorithms, usually encryption algorithms. This usually refers to data that is transmitted or stored unencrypted. Overview With the advent of com ...
M_i from all the
ciphertext In cryptography, ciphertext or cyphertext is the result of encryption performed on plaintext using an algorithm, called a cipher. Ciphertext is also known as encrypted or encoded information because it contains a form of the original plaintext ...
with similar methods. In more generality, Håstad proved that a system of
univariate In mathematics, a univariate object is an expression, equation, function or polynomial involving only one variable. Objects involving more than one variable are multivariate. In some cases the distinction between the univariate and multivariate ...
equations modulo
relatively prime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
composites, such as applying any fixed
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
g_i(M) \equiv 0 \pmod, could be solved if sufficiently many equations are provided. This attack suggests that randomized
padding Padding is thin cushioned material sometimes added to clothes. Padding may also be referred to as batting when used as a layer in lining quilts or as a packaging or stuffing material. When padding is used in clothes, it is often done in an attempt ...
should be used in RSA encryption. ; Theorem 2 (Håstad) : Suppose N_1, \dots, N_k are
relatively prime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
integers An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
and set N_\text = \min_i\. Let g_i (x) \in \mathbb/N_i /math> be k polynomials of maximum
degree Degree may refer to: As a unit of measurement * Degree (angle), a unit of angle measurement ** Degree of geographical latitude ** Degree of geographical longitude * Degree symbol (°), a notation used in science, engineering, and mathematics ...
q. Suppose there exists a unique M < N_\text satisfying g_i(M) \equiv 0 \pmod for all i \in \left\. Furthermore, suppose k > q. There is an efficient
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
that, given \left\langle N_i, g_i (x) \right\rangle for all i, computes M. ; Proof Since the N_i are
relatively prime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
the Chinese remainder theorem might be used to compute
coefficients In mathematics, a coefficient is a multiplicative factor in some term of a polynomial, a series, or an expression; it is usually a number, but may be any expression (including variables such as , and ). When the coefficients are themselves ...
T_i satisfying T_i \equiv 1 \pmod and T_i \equiv 0 \pmod for all i \ne j. Setting g(x) = \sum T_i \cdot g_i(x), we know that g(M) \equiv 0 \pmod. Since the T_i are nonzero, we have that g(x) is also nonzero. The degree of g(x) is at most q. By Coppersmith’s theorem, we may compute all
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
roots x_0 satisfying g(x_0) \equiv 0 \pmod and \left, x_0 \ < \left(\prod N_i\right)^. However, we know that M < N_\text < \left(\prod N_i\right)^ < \left(\prod N_i\right)^ , so M is among the roots found by Coppersmith's theorem. This theorem can be applied to the problem of broadcast RSA in the following manner: Suppose the i-th plaintext is padded with a polynomial f_i(x), so that g_i = \big(f_i(x)\big)^ - C_i \bmod N_i. Then g_i(M) \equiv 0 \bmod N_i is true, and Coppersmith’s method can be used. The attack succeeds once k > \max_i (e_i \cdot \deg f_i), where k is the number of messages. The original result used Håstad’s variant instead of the full Coppersmith method. As a result, it required k = O(q^2) messages, where q = \max_i(e_i \cdot \deg f_i).


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 In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can deci ...
under the same RSA modulus N, then it is possible to recover both of them. The attack was originally described with public exponent e = 3, but it works more generally (with increasing cost as e grows). Let \left\langle N; e_i \right\rangle be Alice's public key. Suppose M_1; M_2 \in \mathbb_N are two distinct messages satisfying M_1 \equiv f(M_2) \pmod for some publicly known
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
f \in \mathbb_N /math>. To send M_1 and M_2 to Alice, Bob may naively
encrypt In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can deci ...
the messages and
transmit Transmit is a file transfer client program for macOS. Developed by Panic, Transmit is shareware. After a seven-day trial period, the product can only be used for seven-minute sessions until it has been purchased. Originally built as an FTP client ...
the resulting ciphertexts C_1; C_2. Eve can easily recover M_1; M_2, given C_1; C_2, by using the following theorem: ; Theorem 3 (Franklin–Reiter) : Let \left\langle N, e \right\rangle be an RSA public key. Let M_1 \ne M_2 \in \mathbb^*_N satisfy M_1 \equiv f(M_2) \pmod for some linear
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
f = ax + b \in \mathbb_N /math> with b \ne 0. Then, given \left\langle N, e, C_1, C_2, f \right\rangle, attacker (Eve) can recover M_1, M_2 in time quadratic in e \cdot \log N. ; Proof Since C_1 \equiv M_1^e \pmod, we know that M_2 is a root of the polynomial g_1(x) = f(x)^e - C_1 \in \mathbb_N /math>. Similarly, M_2 is a root of g_2(x) = x^e - C_2 \in \mathbb_N /math>. Hence, the
linear Linearity is the property of a mathematical relationship ('' function'') that can be graphically represented as a straight line. Linearity is closely related to '' proportionality''. Examples in physics include rectilinear motion, the linear ...
factor x - M_2 divides both
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
s. Therefore, Eve may calculate the
greatest common divisor In mathematics, the greatest common divisor (GCD) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers ''x'', ''y'', the greatest common divisor of ''x'' and ''y'' is ...
\gcd(g_1, g_2) of g_1 and g_2, and if the \gcd turns out to be linear, M_2 is found. The \gcd can be computed in quadratic time in e and \log N using the Euclidean algorithm.


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. Coppersmith showed that if randomized padding suggested by Håstad is used improperly, then RSA
encryption In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can de ...
is not secure. Suppose Bob sends a message M to Alice using a small random padding before
encrypting In cryptography, encryption is the process of Code, encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can ...
it. An attacker, Eve, intercepts the
ciphertext In cryptography, ciphertext or cyphertext is the result of encryption performed on plaintext using an algorithm, called a cipher. Ciphertext is also known as encrypted or encoded information because it contains a form of the original plaintext ...
and prevents it from reaching its destination. Bob decides to resend M to Alice because Alice did not respond to his message. He randomly pads 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 by using the following theorem, if the random padding is too short. ; Theorem 4 (Coppersmith) : Let \left\langle N, e\right\rangle be a public RSA key, where N is n bits long. Set m = \left\lfloor \frac \right\rfloor. Let M \in \mathbb ^*_N be a message of length at most n - m bits. Define M_1 = 2^m M + r_1 and M_2 = 2^m M + r_2, where r_1 and r_2 are distinct
integers An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
with 0 \le r_1, r_2 < 2^m. If Eve is given \left\langle N, e\right\rangle and the encryptions C_1, C_2 of M_1, M_2 (but is not given r_1 or r_2), she can efficiently recover M. ; Proof Define g_1(x, y) = x^e - C_1 and g_2(x, y) = (x + y)^e - C_2. We know that when y = r_2 - r_1, these polynomials have x = M_1 as a common root. In other words, \Delta = r_2 - r_1 is a root of the
resultant In mathematics, the resultant of two polynomials is a polynomial expression of their coefficients, which is equal to zero if and only if the polynomials have a common root (possibly in a field extension), or, equivalently, a common factor (ove ...
h(y) = \operatorname_x(g_1,g_2) \in \mathbb _N /math>. Furthermore, , \Delta, < 2^m < N^. Hence, \Delta is a small root of h modulo N, and Eve can efficiently find it using the Coppersmith method. Once \Delta is known, the Franklin–Reiter attack can be used to recover M_2 and consequently M.


See also

* ROCA attack


References

{{reflist Cryptographic attacks Attacks on public-key cryptosystems