redpwn-2020

CTF Writeup - https://2020.redpwn.net/

View on GitHub
26 June 2020

primimity

by anishbadhri

People claim that RSA with two 1024-bit primes is secure. But I trust no one. That’s why I use three 1024-bit primes.

I even created my own prime generator to be extra cautious!

Files

Solution

It can be seen that in the prime number generator, the three primes generated p, q and r are generated such that

From this, it can be inferred that the difference between two primes is small. We can also infer the same with multiple runs of the generator program.

Using this inference, N can be factorized easily into p, q and r. Since N = p * q * r and p < q < r, p < N1/3, q < r

Solution: solution.py

Flag

flag{pr1m3_pr0x1m1ty_c4n_b3_v3ry_d4ng3r0u5}
tags: crypto