Tags: rsa 

Rating: 5.0

N has known prime factors.


<em>https://en.wikipedia.org/wiki/RSA_numbers#RSA-250</em>

In RSA, these factors are `p` and `q`. These are used to find the decryption key `d`. Here's the solve in Python:

```python
from Crypto.Util.number import *

n = 2140324650240744961264423072839333563008614715144755017797754920881418023447140136643345519095804679610992851872470914587687396261921557363047454770520805119056493106687691590019759405693457452230589325976697471681738069364894699871578494975937497937
e = 65537
c = 1374140457838957379493712264664046131145058468396958574281359672603632278570608567064112242671498606710440678399100851664468278477790512915780318592408890478262161233349656479275652165724092531743704926961399610549341692938259957133256408358261191631

p = 64135289477071580278790190170577389084825014742943447208116859632024532344630238623598752668347708737661925585694639798853367
q = 33372027594978156556226010605355114227940760344767554666784520987023841729210037080257448673296881877565718986258036932062711

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

m = pow(c,d,n)
print(long_to_bytes(m))
```

Output: `b'this_s3miprim3_t00k_2700_CPU_c0r3_y34rs_t0_cr4ck'`

Original writeup (https://github.com/NihilistPenguin/PatriotCTF2022-Writeups/blob/main/Crypto/TwoFifty.md).