Tags: rsa-crypto 

Rating:

# Super Safe RSA - Crypto

On this RSA challenge, we get the following:
```
c: 2425856200769915981651037422985132378377167608258701728568281807599094681752373
n: 27648161471552692194976798121921575562926832795742781625850575808536319404313029
e: 65537
```

First thing I try is to factorize the n on [Alpertron](https://www.alpertron.com.ar/ECM.HTM). Then we get p and q:
```
p = 169164339873385123585987559611932758873
q = 163439655735047847596122332439710591236173
```

Then we create this script to decrypt the ciphertext c:
```python
#!/usr/bin/env python
import libnum

n = 27648161471552692194976798121921575562926832795742781625850575808536319404313029
c = 2425856200769915981651037422985132378377167608258701728568281807599094681752373
e = 65537

p = 169164339873385123585987559611932758873
q = 163439655735047847596122332439710591236173

n=p*q
phi=(p-1)*(q-1)
d = libnum.modular.invmod(e, phi)
print libnum.n2s(pow(c, d, n))
```

After running the script, we get the flag: picoCTF{[email protected]_pr1m3$_2461}

Original writeup (https://github.com/liuhack/writeups/blob/master/2018/picoCTF/Super_safe_RSA/README.md).