Rating:

### Question
To: Dr Rivest CC: Dr Shamir

We found this code and these numbers. data.txt Mean anything to you?

Sincerely

Dr Adleman

data.txt :
```
N = 2095975199372471
e = 5449
gigem{ 875597732337885 1079270043421597 616489707580218 2010079518477891 1620280754358135 616660320758264 86492804386481 171830236437002 1500250422231406 234060757406619 1461569132566245 897825842938043 2010079518477891 234060757406619 1620280754358135 2010079518477891 966944159095310 1669094464917286 1532683993596672 171830236437002 1461569132566245 2010079518477891 221195854354967 1500250422231406 234060757406619 355168739080744 616660320758264 1620280754358135 }

```
### Approach :
As the name suggest, it's basic RSA. Fire up the `N` on [factordb.com](http://factordb.com/), to obtain the primes p and q.
```
from Crypto.Util.number import inverse
from Crypto.Util.number import long_to_bytes

N = 2095975199372471
e = 5449
# gigem{ 875597732337885 1079270043421597 616489707580218 2010079518477891 1620280754358135 616660320758264 86492804386481 171830236437002 1500250422231406 234060757406619 1461569132566245 897825842938043 2010079518477891 234060757406619 1620280754358135 2010079518477891 966944159095310 1669094464917286 1532683993596672 171830236437002 1461569132566245 2010079518477891 221195854354967 1500250422231406 234060757406619 355168739080744 616660320758264 1620280754358135 }
shit = [int(_) for _ in "875597732337885 1079270043421597 616489707580218 2010079518477891 1620280754358135 616660320758264 86492804386481 171830236437002 1500250422231406 234060757406619 1461569132566245 897825842938043 2010079518477891 234060757406619 1620280754358135 2010079518477891 966944159095310 1669094464917286 1532683993596672 171830236437002 1461569132566245 2010079518477891 221195854354967 1500250422231406 234060757406619 355168739080744 616660320758264 1620280754358135".split()]

p = 21094081
q = 99363191

phi = (p - 1) * (q - 1)
d = inverse(e, phi)

for i in shit:
m = pow(i, d, N)
print(str(long_to_bytes(m), "utf-8"), end='')
```
`RSA_s3cur1ty_1s_4b0ut_pr1m3s`

`gigem{RSA_s3cur1ty_1s_4b0ut_pr1m3s}` is the flag.

Original writeup (https://github.com/x-0117/CTF-Writeups/blob/main/TAMU%20CTF/Basic%20RSA.md).