Home
Writeups Misc About
Ron Was Wrong, Whit Is Right

Ron was Wrong, Whit is Right

Long challenge name, but short story. We are given an article at this link, outlining the difficulties in generating RSA keys such that there are no two public keys using the same prime. Because if that's the case, one can very efficiently recover the factorisation by doing Euclid's Algorithm, which runs in polynomial time (and thus much faster compared to factorising), to obtain one of the two primes used in the modulus.

In other words, with two public modulo n1,n2, where n1=pq1 and n2=pq2, we can recover p by using Euclid's Algorithm to calculate gcd(n1,n2)=p, assuming that q1 and q2 are relatively prime.

What's left in the challenge is the script to check every possible pair of modulo whether there exists some greatest common divisor greater than 1, then if one such pair is found, we can perform decryption. The name of the challenge is the name of the paper on this topic. There are some syntax difficulties working with the RSA module of pycryptodome, but from the previous challenges we should have a good idea of how to do decryption on the Python module now.