The algorithms are rarely the weak point. What breaks systems is how the pieces are combined: a value that must never repeat, a mode chosen for convenience, a hash used for a job it was never meant to do. This set covers the mistakes that keep turning up.
Each one is marked as you go, and the explanation arrives straight after, which is
the part worth reading.
4 questions, marked as you go.
Tasks
These need your own device. Run the command in Termux, then paste what it printed.
The marking looks at what the output means, so spacing, version numbers and
ordering do not matter. If you have not installed anything yet, the
lesson covers the setup.
See ECB repeat a block and CBC break the pattern
This encrypts the same two identical blocks with ECB, then with CBC, and prints the ciphertext as hex bytes. Read the ECB pair and the CBC pair and compare them.
Run this in Termux
On your own device. Nothing on this page executes it. The command runs in
your terminal, and this box only reads what you paste back.
Look at the two lines under ECB mode and then the two under CBC mode. Under ECB the two lines should be identical; under CBC they should differ.
ECB repeats the same block for the same plaintext
each block is printed as 16 bytes of hex
both modes print their blocks
the commands actually ran
What a good answer looks like
Two labelled sections, each printing two lines of sixteen hex bytes. Under ECB mode the two lines are identical, because the two plaintext blocks were identical and ECB encrypts each block on its own. Under CBC mode the two lines differ, because each block is chained to the one before it and so the same plaintext block no longer produces the same ciphertext. The same AES key was used in both sections, which shows the fault is the mode.
Marking your own work
Both halves of this are checked in your browser, with no server involved, so nothing
stops you from pasting output you did not run. The tasks are written so that the
easiest way to pass one is to actually do it and read the result, which is the whole
intention.