1
$\begingroup$

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

Question related to "Pinhole Attack" task from Tokyo Westerns/MMA ctf.

$\endgroup$
5
$\begingroup$

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?

$\endgroup$
1
  • $\begingroup$ foa. it's from competition, meaning not homework. I know about multiplicative property of RSA and how to decrypt message given LSB of plaintext. But still can't see what to do with middle bits (or, say, arbitrary at fixed location). $\endgroup$ – Gros Sep 8 '16 at 7:34
1
$\begingroup$

There is a good write up of this task from More Smoked Leet Chicken team.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.