ArticleslgStudy

computer science

Wiener's attack

Wiener's attack is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Wiener's attack rather than just read about it. In short: The Wiener's attack, named after cryptologist Michael J. Wiener, is a type of cryptographic attack against RSA.

Key takeaways

  • Wiener's attack belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Wiener's attack to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Wiener's attack from memory before moving on to harder problems.

Reference excerpt

The Wiener's attack, named after cryptologist Michael J. Wiener, is a type of cryptographic attack against RSA. The attack uses continued fraction representation to expose the private key d when d is small.

Background on RSA Fictional characters Alice and Bob are people who want to communicate securely. More specifically, Alice wants to send a message to Bob which only Bob can read. First Bob chooses two secret primes p and q. Then he calculates the RSA modulus N = pq. This RSA modulus is made public together with the encryption exponent e. N and e form the public key pair (e, N). By making this information public, anyone can encrypt messages to Bob. The decryption exponent d satisfies ed ≡ 1 (mod λ(N)), where λ(N) denotes the Carmichael function, though sometimes φ(N), the Euler's totient function, is used (note: this is the order of the multiplicative group (Z‍/‍NZ)×, which is not necessarily a cyclic group). The encryption exponent e and λ(N) also must be relatively prime so that there is a modular inverse. The factorization of N and the private key d are kept secret, so that only Bob can decrypt the message. We denote the private key pair as (d, N). The encryption of the message M is given by C ≡ Me (mod N) and the decryption of cipher text C is given by Cd ≡ (Me)d ≡ Med ≡ M (mod N) (using Euler's Theorem). Using the Euclidean algorithm, one can efficiently recover the secret key d if one knows the factorization of N. By having the secret key d, one can efficiently factor the modulus of N.

Small private key In the RSA cryptosystem, Bob might tend to use a small value of d, rather than a large random number to improve the RSA decryption performance. However, Wiener's attack shows that choosing a small value for d will result in an insecure system in which an attacker can recover all secret information, i.e., break the RSA system. This break is based on Wiener's theorem, which holds for small values of d. Wiener has proved that the attacker may efficiently find d when d < ⁠1/3⁠ N1/4. Wiener's paper also presented some countermeasures against his attack that allow fast decryption. Two techniques are described as follows. Choosing large public key: Replace e by e′, where e′ = e + k ⋅ λ(N) for some large of k. When e′ is large enough, i.e. e′ > N3/2, then Wiener's attack cannot be applied regardless of how small d is. Using the Chinese remainder theorem: Suppose one chooses d such that both dp ≡ d (mod (p − 1)) and dq ≡ d (mod (q − 1)) are small but d itself is not, then a fast decryption of C can be done as follows:

First compute Mp ≡ Cdp (mod p) and Mq ≡ Cdq (mod q). Use the Chinese remainder theorem to compute the unique value of 0 ≤ M < N that satisfies M ≡ Mp (mod p) and M ≡ Mq (mod q. The result of M satisfies M ≡ Cd (mod N) as needed. The point is that Wiener's attack does not apply here because the value of d mod λ(N) can be large.

How the attack works Note that

λ ( N ) = lcm ⁡ ( p − 1 , q − 1 ) = ( p − 1 ) ( q − 1 ) G = φ ( N ) G {\displaystyle \lambda (N)=\operatorname {lcm} (p-1,q-1)={\frac {(p-1)(q-1)}{G}}={\frac {\varphi (N)}{G}}}

where G = gcd(p − 1, q − 1). Since ed ≡ 1 (mod λ(N)), there exists an integer K such that

e d = K × λ ( N ) + 1 {\displaystyle ed=K\times \lambda (N)+1}

e d = K G ( p − 1 ) ( q − 1 ) + 1 {\displaystyle ed={\frac {K}{G}}(p-1)(q-1)+1}

Defining k = ⁠K/gcd(K, G)⁠ and g = ⁠G/gcd(K, G)⁠, and substituting into the above gives:

e d = k g ( p − 1 ) ( q − 1 ) + 1 {\displaystyle ed={\frac {k}{g}}(p-1)(q-1)+1} . Divided by dpq:

e p q = k d g ( 1 − δ ) {\displaystyle {\frac {e}{pq}}={\frac {k}{dg}}(1-\delta )} , where δ = p + q − 1 − g k p q {\displaystyle \delta ={\frac {p+q-1-{\frac {g}{k}}}{pq}}} . So, ⁠e/pq⁠ is slightly smaller than ⁠k/dg⁠, and the former is composed entirely of public information. However, a method of checking and guess is still required. By using simple algebraic manipulations and identities, a guess can be checked for accuracy.

Wiener's theorem Let N = pq with q < p < 2q. Let d < ⁠1/3⁠ N1/4. Given ⟨N, e⟩ with ed ≡ 1 (mod λ(N)), the attacker can efficiently recover d.

Example

Suppose that the public keys are ⟨N, e⟩ = ⟨90581, 17993⟩. The attack should determine d. By using Wiener's theorem and continued fractions to approximate d, first we try to find the continued fractions expansion of ⁠e/N⁠. Note that this algorithm finds fractions in their lowest terms. We know that

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Wiener's attack

Start with the simplest possible case. Write down what Wiener's attack claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Wiener's attack before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Wiener's attack ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Wiener's attack

In research
Wiener's attack appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Wiener's attack in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Wiener's attack is common in secondary-school and first-year university syllabi. It links to neighbouring topics Asymmetric-key algorithms, Attacks on public-key cryptosystems, Cryptographic attacks, so understanding it makes those chapters shorter.
In everyday life
Look for Wiener's attack outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Wiener's attack in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Wiener's attack means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Wiener's attack out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Wiener's attack in simple terms?

The Wiener's attack, named after cryptologist Michael J. Wiener, is a type of cryptographic attack against RSA.

Why does Wiener's attack matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Wiener's attack?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Wiener's attack.

Tags

  • Asymmetric-key algorithms
  • Attacks on public-key cryptosystems
  • Cryptographic attacks

Keep exploring