Original Challenge Description from matasano
Detect AES in ECB mode
In this file are a bunch of hex-encoded ciphertexts.
One of them has been encrypted with ECB.
Detect it.
Remember that the problem with ECB is that it is stateless and deterministic; the same 16 byte plaintext block will always produce the same 16 byte ciphertext.
My Solution
- Since one byte represents two nibbles, in our give file we need to find duplicate patterns in the the block of 32. "fold" command is our friend
- Now what we need to do is get these blocks for every line of the input and see if there are any duplicates. "sort" and "wc" can be used in a loop.
that marks the end of Set 1!
No comments:
Post a Comment