I want to do an RSA! output.txt
Right off the bat: RSA encryption time. Let's open up the file and see what we have
n: 228430203128652625114739053365339856393
e: 65537
c: 126721104148692049427127809839057445790
Wow, small N. Let's use an integar factorization calculator
Factoring n gives us p = 12546190522253739887
and q = 18207136478875858439
Using this we can find the toient and in turn the private key to decrypt the ciphertext. Here is the solvescript:
n = 228430203128652625114739053365339856393
e = 65537
c = 126721104148692049427127809839057445790
p = 12546190522253739887
q = 18207136478875858439
phi = (p - 1) * (q - 1)
priv_key = pow(e, -1, phi)
m = hex(pow(c, priv_key, n))[2:] #We decode the plaintext from an int to hex
print(m)
Output: 666c61677b363861623832646633347d Now we can use any hex to ASCII converter and obtain our flag!
flag{68ab82df34}