The Obligatory RSA Challenge Writeup (Dawg CTF 2021)

panda1729

Type: Crypto

Difficulty: Easy

Prompt: Would you believe last year someone complained because we didn't have any RSA challenges?

Solution

Just like the previous RSA challenge of this CTF, n is again a square and can be factored easily.

Download the file here

Find the factors (‘factor’ actually) using factordb and assign the values of n, p, e & c in the python console.

Totient function when p and q are equal is p(p-1)

>>> phi = p*(p-1)
>>> d = pow(e, -1, phi)
>>> m = pow(c, d, n)
>>> bytes.fromhex(hex(m)[2:]).decode('utf-8')
'DawgCTF{wh0_n33ds_Q_@nyw@y}'