Tags: cca 

Rating:

# Decryptor

**Challenge Points**: 447

**Challenge Description**: I created this nice decryptor for RSA ciphertexts, you should try it out!

Chosen Ciphertext Attack on RSA unpadded encryption. Similar challenge writeup: https://masterpessimistaa.wordpress.com/2018/03/04/pragyan-ctf-rsas-quest/

Full exploit script for this challenge:
```python
from pwn import *
from Crypto.Util.number import *

r = remote("chal.noxale.com","4242")
r.recvline().strip()

N = 140165355674296399459239442258630641339281917770736077969396713192714338090714726890918178888723629353043167144351074222216025145349467583141291274172356560132771690830020353668100494447956043734613525952945037667879068512918232837185005693504551982611886445611514773529698595162274883360353962852882911457919
e = 65537
c = 86445915530920147553767348020686132564453377048106098831426077547738998373682256014690928256854752252580894971618956714013602556152722531577337080534714463052378206442086672725486411296963581166836329721403101091377505869510101752378162287172126836920825099014089297075416142603776647872962582390687281063434

chosen_ct = (c * pow(2, e, N)) % N
r.sendline(hex(chosen_ct)[2:].replace("L",""))

_pt = int(r.recvline().strip(), 16)
print long_to_bytes(_pt/2)
```

Running this script gives us the flag: **noxCTF{0u7sm4r73d}**

Original writeup (https://github.com/ashutosh1206/Crypto-CTF-Writeups/tree/master/2018/noxCTF/Decryptor).