Last updated
Last updated
From the script, we can produce the following equations e1 * d = 1 mod phi e2 * (d + 2) = 1 mod phi
Rearranging e1 * d = 1 mod phi e2 * d + e2 * 2) = 1 mod phi
Then, we subtract e2*2 from 1 to get e1 * d = 1 mod phi e2 * d = some negative number
We then can do a trick I learnt from FwordCTF (kinda)
We multiply both equations by the opposite value to get
e1 * d * e2 = e2 e1 * e2 * d = some negative number * e1
Now we know that these are both the same, so we can simply subtract them from each other to get a multiple of phi.
If we know k*phi, we can just use that as phi, since that will still work. We use this then to get the flag.
Solve script below.