PicoCTF - No Padding, No Problem
tags: PicoCTF
CTF
Crypto
Description
Oracles can be your best friend, they will decrypt anything, except the flag’s ciphertext. How will you break it? Connect with nc mercury.picoctf.net 10333.
Hint
What can you do with a different pair of ciphertext and plaintext? What if it is not so different after all…
Recon
We can try to decrypt ciphertext directly.
1 |
|
Exploit
We know that $Enc(m_1) * Enc(m_2) = ((m_1^e) * (m_2^e))\ mod\ n = (m_1 * m_2)^e\ mod\ n = Enc(m_1 * m_2)$ \(c' = 2^e\ (mod\ n)*c \\ \begin{align} m' &= {c'}^d\ (mod\ n) \\ &= 2^{ed}*c^d\ (mod\ n) \\ &= 2 * c^d\ (mod\ n) \\ \end{align}\\ m = m' // 2\)
1 |
|