Tags: crypto oracle-padding
Rating:
Mr Robot has worked all night to find the Cipher "TIe8CkeWpqPFBmFcIqZG0JoGqBIWZ9dHbDqqfdx2hPlqHvwH/+tbAXDSyzyrn1Wf" then he faints of Overdose. You are left with a challenge to get the key to the database before EVIL CORP starts backing up the data.
nc ctf.pragyan.org 8500
P.S- After solving you will get a flag in the format of pctf{code}, change it to p_ctf{code} and submit it.
It is a traditional oracle padding attack(OPA). To apply the attack,
SIZE = 16
iv
)
iv_default = "This is an IV456"
iv|ct
pairs.Reason of why OPA works will be not introduced here. Check here for detailed explanation. The total ciphertext length was 48
bytes, and we need 256 queries per leaking bytes. Therefore, we need at most 48 * 256
queries. Each query took about more than 0.5
s, and it took quite a time to leak the whole flag. With patience and time, I get the flag:
pctf{b@d_p@nd@s_@r3_3v3rywh3r3_c@tch}
Exploit code: solve.py