AES · 04 Worked example

AES: worked example

The official FIPS 197 test vector for AES-128 and how to use it to check an implementation.

The FIPS 197 standard contains official examples, called test vectors, that anyone can use to check that an AES implementation works. Here is the one for AES-128, in hexadecimal:

terminale
Key        000102030405060708090a0b0c0d0e0f
Plaintext  00112233445566778899aabbccddeeff
Ciphertext 69c4e0d86a7b0430d8cdb78070b4c55a

Each pair of hexadecimal characters is a byte: key, plaintext and ciphertext are 16 bytes long, that is 128 bits.

The avalanche effect

If a single bit of the key or the plaintext changes, the ciphertext changes in an apparently random way, on average in half its bits. This is the avalanche effect, a direct consequence of confusion and diffusion.

terminale
$ echo 00112233445566778899aabbccddeeff | xxd -r -p | openssl enc -aes-128-ecb -nopad -K 000102030405060708090a0b0c0d0e0f | xxd -p
69c4e0d86a7b0430d8cdb78070b4c55a
Continue with
05 Weaknesses and attacks

AES: weaknesses and attacks

Theoretical attacks, side channels, misuse of modes and quantum computers: what really threatens AES.

↑