Skip to main content
2 of 4
polish
kelalaka
  • 49.5k
  • 12
  • 119
  • 205

You have and oracle call of

$$O(\texttt{your-string}) = (\operatorname{AES-128-ECB}(\texttt{your-string} || \texttt{unknown-string})$$

Since you know that the AES has 16-byte block cipher and it uses CBC, request;

$$C = O(\texttt{AAAAAAAAAAAAAAAx})$$ from oracle, where $\texttt{x}$ is the first byte of the random key.

Now ask to oracle these encryptions $$C = O(\texttt{AAAAAAAAAAAAAAA[a..zA..Z]})$$ and see which character is equal to $\texttt{x}$.

Now once we determine the $\texttt{x}$, we can move to the next one. Request from Oracle;

$$C = O(\texttt{AAAAAAAAAAAAAAxy})$$

Now ask to oracle these encryptions $$C = O(\texttt{AAAAAAAAAAAAAAx[a..zA..Z]})$$ and see which character is equal to the second byte $\texttt{y}$ of the string.

With this method, we can get 16 bytes of the secret. What about if there are more. Request

$$C = O(\texttt{AAAAAAAAAAAAAAAx||known 15 byte of the secretX})$$

then request

$$C = O(\texttt{AAAAAAAAAAAAAAAx||known 15 byte of the secret[a..zA..Z]})$$

to determine the 17th byte $\texttt{X}$, the rest is similar.

kelalaka
  • 49.5k
  • 12
  • 119
  • 205