Really Secure Algorithm Writeup (Dawg CTF 2021)
Type: Crypto
Difficulty: Easy
Prompt:
I like my e's like I like my trucks: big and obnoxious
Solution
Just a basic RSA challenge with a very big n. But here’s the catch - n is a square! The totient function in this case is not (p-1)2 but p(p-1)
Use factordb.com or factordb-pycli
(or simply take the squareroot) to factorise the huge n and note the primes (‘prime’ actually since its just one)
Fire up your python console and assign the respective values to n, p, e and c
>>> phi = p*(p-1)
>>> d = pow(e, -1, phi)
>>> m = pow(c, d, n)
>>> bytes.fromhex(hex(m)[2:]).decode('utf-8')
'DawgCTF{sm@ll_d_b1g_dr3am5}'