PlaidCTF 2017 - Multicast
The same flag is encrypted 5 times with RSA small public exponent and linear padding. The generalization of Håstad’s broadcast attack and the Coppersmith method allow to recover the flag.
Many messages intercepted.
Two files were given, one with 20 large integers and one Sage script. The script file consists in encrypting the same flag 5 times with RSA and public exponent $e = 5$. Hopefully the padding values $a_i$ and $b_i$ are also given in the file as well as the modulus $n_i$ and the ciphertexts $c_i$. We noticed that the generalization of the Håstad’s broadcast attack allows us to solve this challenge. With these values we can create the polynomials $h_i(x) = (a_i x + b_i)^5 -c_i$. Then we make each $h_i$ monic by dividing them with the coeficient of degree 5. We used the Chinise remainder theorem to find the values $T_i$ such that $T_i = 1 \mod n_i$ and $T_i = 0\mod n_j$ for $i \neq j$. With those value we could built the combined polynomial:
$h(x) = \sum T_i h_i(x) \mod n_1 \cdot n_2 \cdot n_3 \cdot n_4 \cdot n_5$
Now we have to solve the equation $h(x) = 0$ and a solution will be the flag. We used the Coppersmith method to solve the equation and the sage script given by David Wong. The complete Sage script to recover the flag that was:
Which reveals the flag: