Decrypt RSA ciphertext with two middle bits leak Given RSA public key (e.g. 1024 bits) and decryption oracle that outputs 2 middle bits of decrypted ciphertext (pow(ciphertext,d,n) &gt;&gt; (1024/2)) &amp; 3, how can we decrypt whole message?

Question related to "Pinhole Attack" task from Tokyo Westerns/MMA ctf.
This appears to be homework, and so I won't tell your outright; I will give you a hint.

Suppose you compute:

$$c_1 = c \times 2^e \bmod n$$

How are the decryptions of $c$ and $c_1$ related?

Suppose we compute a long series of:

$$c_i = c \times (2^i)^e \bmod n$$

What does the middle two bits of $c_i$ tell us?