Let encrypted_flag
. We are going to perform a Binary Search to compute the value of
First, let's define a function is_error(x:int)->bool
. is_error(x)
will ask the server to decrypt True
if the server encounters an invalid padding. Recall that in RSA, using \x00
. I.e., if the plaintext is smaller than some fixed threshold, then it passes the padding check.
The hint to this challenge will be the answers to the following questions:
- What do you expect
is_error(1)
to return? - What do you expect
is_error(x)
to return whenx
is a small integer close to1
? - As you continue to increase the value of
x
, you'd expectis_error(x)
to start returningTrue
. Eventual