Path: blob/main/foundations/04-number-theory-rsa/break/hastads-broadcast-attack.ipynb
483 views
Break: Hastad's Broadcast Attack
Module 04 | Breaking Weak Parameters
Recover plaintext when the same message is encrypted to different recipients with small and no padding.
Why This Matters
Textbook RSA with a small public exponent and no randomized padding is vulnerable to a devastating attack discovered by Johan Hastad (1985).
The scenario is realistic: a system broadcasts the same message to multiple recipients, each with their own RSA public key but the same small exponent . An eavesdropper who collects just ciphertexts can recover the plaintext without factoring any modulus.
The attack uses only two tools from Module 04:
The Chinese Remainder Theorem (Notebook 04d)
An integer cube root (basic arithmetic)
The Scenario
Alice sends the same plaintext message to three recipients. Each recipient has their own RSA key pair, but all use the same small public exponent :
| Recipient | Public Key | Ciphertext |
|---|---|---|
| Bob | ||
| Carol | ||
| Dave |
The attacker intercepts all three ciphertexts. Since for each , we know . The CRT lets us recover exactly, and then we take the integer cube root.
Step 2: Use CRT to Recover
We have the system of congruences:
Since are pairwise coprime, the CRT guarantees a unique solution modulo such that:
The key insight: since for all , we have . So exactly as an integer --- no modular reduction happened!
Step 3: Take the Integer Cube Root
We now have the exact value (not reduced modulo anything). Taking the integer cube root recovers directly:
No factoring. No private keys. Just CRT and a cube root.
Cost Analysis
Let's compare the cost of this attack vs. the "honest" approach of factoring.
The Fix: Randomized Padding (OAEP)
The attack works because the same plaintext is encrypted each time. If we add random padding before encryption, each recipient sees a different padded message:
where is fresh randomness for each encryption. Now the CRT recovers combined with and , which are three different values --- the system of congruences yields garbage.
RSA-OAEP (see the Connect notebook on OAEP) is the standard way to add this padding. It ensures that even identical messages produce different ciphertexts.
Exercises
with 5 recipients: Modify the attack for . Generate 5 RSA key pairs with , encrypt the same message, and recover it using CRT + 5th root.
What if is large? What happens if ? Try with a message close to in size. Does the attack still work? Why or why not?
Partial information: If you only have 2 ciphertexts (not 3) with , can you still recover ? What additional information would you need?
Summary
| Component | Role in the Attack |
|---|---|
| Small | Means is "small" relative to the product of moduli |
| No padding | Same encrypted each time, enabling CRT combination |
| CRT (Notebook 04d) | Recovers exactly from congruences |
| Integer -th root | Extracts from (works because ) |
Key takeaways:
Textbook RSA with small and no padding is completely broken when the same message is sent to or more recipients.
The attack costs essentially nothing: one CRT computation and one -th root.
Randomized padding (OAEP) is the fix: it makes each ciphertext depend on fresh randomness, so the CRT combination produces garbage.
This is why every RSA standard mandates padding. Textbook RSA is a teaching tool, not a cryptosystem.
Back to Module 04: Number Theory and RSA