LSB (parity) oracle
Some servers decrypt the ciphertext and return only the last bit (even/odd) of the result — as if this is "harmless" information. In fact, even this single bit reveals the entire message.
The reason: the last bit of 2·m mod n tells us whether m < n/2 or m ≥ n/2 (since n is odd). By asking for the answer for 4·m, 8·m, … each time, we squeeze the message into the range of n/2, n/4, … using binary search.
The oracle has already answered 511 requests: the i-th answer = the last bit of (2^(i+1) · m mod n). These bits are in the attached oracle_javoblari.txt file (0/1 string, from left to right i = 0, 1, 2, ...).
n =
5156217139785565706737677144050559241104316233958988859924290902
6918367779233179154409271678069794392155013902806833733709761026
26639996768071178421440203
e = 65537,
c =
4074593035646570588079725312009964080874292993745836666869369461
1618545964448566099173986334935605915029836832901887767692070662
09483957171815343210270637
Use fractions (Fraction): [lo, hi] = [0, n], divide in half at each step. At the end, round hi to an integer and check that pow(m, e, n) == c.