IT lexicon › Security › Byte-at-a-time attack

Byte-at-a-time attack

Security På svenska → Updated: 2026-10-13

A classic way to recover a hidden secret under ECB one byte at a time by letting the attacker control the plaintext.

The attacker sends short inputs that push an unknown secret across a block boundary. Because ECB encrypts identical blocks identically, the attacker can compare the output with every possible final byte, guess the next character, and repeat. No key is needed, only the ability to get ciphertext for chosen input.

It is one of the exercises in the Cryptopals challenges, published by Matasano Security in 2012, and it explains why ECB is rarely a sensible choice outside of demonstrations. An authenticated mode such as AES-GCM is far better.

← Back to the lexicon