Noob RSA Returns
Cryptography · BITSCTF 2025
Problem

As this challenge only had 13 solves at the end of the CTF, I deliberately chose it and decided to explain the solution.
Analysis
One thing we need to focus on is the equation that defines K Mathematically expressed as:
By multiplying both sides, we will get:
Solution
Finding p:
The script tries to find the prime factor ppp by solving an equation for each value of
zin the range[START, e]The equation relates
p,z, and other parameters (including n) to eventually factor nnn.
Equation Setup:
The equation:
is derived to calculate ppp. It depends on the unknown prime p, and the loop iterates over possible values of z.
Loop and Progress Bar:
The
tqdmloop iterates over values ofz, solving the equation to find valid integer solutions for p. Once a valid p is found, it exits the loop.
Flag: BITSCTF{I_H0P3_Y0UR3_H4V1NG_FUN_S0_F4R_EHEHEHEHEHO_93A5B675}
Last updated