Hastad's Broadcast Attack
- •
What it is
- •
If the same message is encrypted with a small public exponent (classically 3) under or more different moduli (e.g. broadcasting the same message to several recipients, each with their own RSA key), an eavesdropper who collects all the ciphertexts can recover the plaintext without factoring anything or knowing any private key. Since for every modulus, is smaller than the product of any of the moduli — so combining the congruences via the Chinese Remainder Theorem recovers exactly, over the integers, with no modular wraparound left to resolve; a plain integer -th root then gives directly.
- •
- •
When to apply
- •
The same plaintext (or a message with a fixed, guessable format) is encrypted with a small, fixed exponent across at least distinct moduli, and you have the ciphertext and modulus for each.
- •
- •
Math
- •
For ciphertexts (pairwise coprime moduli), CRT gives a unique ; since (as for all ), exactly as integers, so .
- •
- •
Worked example
- •
Encrypt with under pairwise-coprime , , and . The ciphertexts are , , and . CRT reconstructs because it is smaller than ; the exact integer cube root returns .
- •
- •
Python
- •
def crt_pair(a1, n1, a2, n2): k = (a2 - a1) % n2 t = (k * pow(n1 % n2, -1, n2)) % n2 return a1 + t*n1, n1*n2 def crt_many(residues, moduli): x, mod = residues[0], moduli[0] for a, n in zip(residues[1:], moduli[1:]): x, mod = crt_pair(x, mod, a, n) return x, mod C, _ = crt_many([c1, c2, c3], [n1, n2, n3]) from gmpy2 import iroot m, exact = iroot(C, 3) # exact will be True if it really was a broadcast
- •
- •
SageMath
- •
crt([c1,c2,c3], [n1,n2,n3])handles the combination step in one call, andInteger(C).nth_root(3, truncate_mode=True)handles the root — tidier syntax, same underlying approach as the Python version.
- •
- •