Description:
Connect to OTP generator server, and try to find one OTP.
This is secure than first server 🙂
nc 66.172.33.77 12431

Here is the [E]ncryption fuction
This challenge is similar to the “a fine OTP server“ challenge. The otp is the concatenation of template_phrase and 18-bytes passphrase and the encrypted OTP are compute as:
(1)
but now, the template_phrase is longer. So, the otp cubed now larger than the modulus n and we can’t compute the otp as the cube root of the encrypted OTP.
The server use 2048-bits key with the public exponent is 3. We can use openssl or python to extract the key.

Let take a look at the equation:
(2)
Let the otp0 is the otp with the 18-null-bytes-passphrase, otherwise, otp0 is the concatenation of template_phrase and 18-bytes “\x00”, then we have the difference between otp0 and otp1 is the passphrase.
(3)
Combine equations (1), (2) and (3), let a = otp0, b = passphrase1, we have:
We can easily compute the encrypted of otp0:
then :
Now, we have the right-side of the equation is smaller than the modulus then we can tranform that congruence equation into polynomial equation:
Now, we can easily compute the passphrase1 by solving the cubic equation.

Submit the OTP and get the flag 😀

That ‘s all and the flag is “ASIS{gj____Finally_y0u_have_found_This_is_Franklin-Reiter’s_attack_CongratZ_ZZzZ!_!!!}”.