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:
Key 000102030405060708090a0b0c0d0e0f
Plaintext 00112233445566778899aabbccddeeff
Ciphertext 69c4e0d86a7b0430d8cdb78070b4c55aEach 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.
$ echo 00112233445566778899aabbccddeeff | xxd -r -p | openssl enc -aes-128-ecb -nopad -K 000102030405060708090a0b0c0d0e0f | xxd -p
69c4e0d86a7b0430d8cdb78070b4c55aAES: weaknesses and attacks
Theoretical attacks, side channels, misuse of modes and quantum computers: what really threatens AES.
The pages of this topic
Back to the overviewAES: how it works
The 16-byte state, the four steps of each round — SubBytes, ShiftRows, MixColumns, AddRoundKey — and the role of modes of operation.
AES: history
From the decline of DES to the NIST competition, from Rijndael’s victory to the publication of the FIPS 197 standard.
AES: the maths
The finite field with 256 elements, the construction of the S-box and the MixColumns calculation: the mathematics that makes AES robust.
AES today
Where AES is used every day — web, Wi-Fi, disks, messages, archives — and why it is considered adequate for the future too.
AES: pitfalls to avoid
The most common mistakes made by those who use AES in their own programs: wrong modes, weak keys, repeated vectors, lack of authentication.
AES: frequently asked questions
Short answers to the most common doubts about AES, key length, security and quantum computers.