3
$\begingroup$

I'm going through the Matasano crypto challenges (also known as cryptopals) and I recently got stuck in the following challenge: http://cryptopals.com/sets/2/challenges/11

The goal of the challenge is detecting the block cipher mode in AES encryption: ECB or CBC.

I saw the following post that discusses this matter, but it doesn't truly solves the problem: https://stackoverflow.com/questions/17382438/how-to-detect-block-cipher-mode

The only flaw that I know of that can help detecting the mode of operation is that ECB is stateless, i.e. similar plaintext blocks convert to similar ciphertext blocks. But in the challenge it is specified that we need to add a random number of bytes (between 5 and 10) before and after the plaintext, which causes similar blocks to slide a bit so the ciphertext result doesn't necessarily contain similar blocks. Does anyone have any hint or solution to this problem?

$\endgroup$
3
$\begingroup$

Hint: Use the plaintext XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, where the (arbitrarily chosen) byte X is repeated at least 48 = 3 × 16 times (so that, no matter how many random bytes are prepended to this plaintext, it will always cover at least two successive AES blocks).

$\endgroup$
  • $\begingroup$ So the only way to detect the mode of operation in these settings are for plaintexts of this type? $\endgroup$ – Lior Moshe Nov 19 '17 at 12:46

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.