Common Factor
52 solves/ 383 points
Source files and Solve Script: TMUCTF/Common%20Factor
Factoring N:
If we look closely at the first hint, we can find one of the factors of N,
nx2+x3+y1∴p2=p1⋅p2⋅p3⋅p4⋅p5=p22+p1p2+p12p2+p22p1=p2(p1+p2)(p1+1)=h1(say)=gcd(n,h1)(1)
From here, we can proceed to find another prime by solving the quadratic from (1)
p12p2+(p22+p2)p1+(p2−h1)=0 ∴p1=2p2−(p22+p2)±(p22+p2)2−4p2(p2−h1)
From the 2nd hint, we can find another factor
y2+y3h2+2p3=p22⋅(p3+1)−1+p1⋅p2⋅(p3+1)−1=h2(say)=(p3+1)⋅(p22+p1⋅p2)=(p22+p1⋅p2)(h2+2)−1
At this point, we have 3/5 primes and I don't know how to find the other 2. Then I had a wild thought that if the flag is small enough i.e. Flag≤3∗2048bits then we can decrypt it with these 3 primes we found!
So, I used N=p1⋅p2⋅p3 and got the flag!
Flag: TMUCTF{Y35!!!__M4Y_N0t_4lW4y5_N33d_4ll_p21M3_f4c70R5}
Note:
The flag is small enough(423 bits only). Thus we can use only one prime to solve this challenge!
Last updated