# LINE CTF 2021 - Crypto - babycrypto3
```txt$ ./msieve -q -v -t 16 -e
Msieve v. 1.53 (SVN unknown)Sat Mar 20 10:16:39 2021random seeds: 341f86e1 eead51a2factoring 31864103015143373750025799158312253992115354944560440908105912458749205531455987590931871433911971516176954193675507337 (119 digits)searching for 15-digit factorssearching for 20-digit factorssearching for 25-digit factors200 of 214 curvescompleted 214 ECM curvessearching for 30-digit factorsECM stage 2 factor foundp42 factor: 291664785919250248097148750343149685985101p78 factor: 109249057662947381148470526527596255527988598887891132224092529799478353198637elapsed time 00:01:27```
```pyfrom Crypto.PublicKey import RSAfrom Crypto.Util.number import long_to_bytes, bytes_to_long
f = open('pub.pem', 'r')key = RSA.importKey(f.read())
p = 291664785919250248097148750343149685985101q = 109249057662947381148470526527596255527988598887891132224092529799478353198637
with open('ciphertext.txt', 'rb') as f:    c = bytes_to_long(f.read())    d = pow(key.e, -1, (p-1)*(q-1))    m = pow(c, d, key.n)    print(long_to_bytes(m))```
```sh❯ python a.pyb'\x02`g\xff\x85\x1e\xcd\xcba\xe5\x0b\x83\xa5\x15\xe3\x00Q0xPU0lORyBUSEUgRElTVEFOQ0UuCg==\n'
❯ echo -n Q0xPU0lORyBUSEUgRElTVEFOQ0UuCg== | base64 -dCLOSING THE DISTANCE.```
`LINECTF{CLOSING THE DISTANCE.}`