Skip to content

Files

Latest commit

author
idekctf
Jul 12, 2021
237c8b0 · Jul 12, 2021

History

History
30 lines (28 loc) · 1.13 KB

baby.md

File metadata and controls

30 lines (28 loc) · 1.13 KB

baby (827 solves/102 points)

Description:

I want to do an RSA! output.txt

Solution:

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:

flag{68ab82df34}