Course contentsShow
← Security
Lesson 91 of 3,0523. Symmetric Cryptography Deep DiveFree lesson

AES Key Expansion and Schedule

Understand how AES derives round keys from the master key for 128, 192, and 256-bit variants.

AES Key Expansion and Schedule

You'll learn how AES transforms a single master key into multiple round keys for its encryption rounds.

Why We Need Key Expansion

AES doesn't use the same key for every round of encryption. Instead, it takes your original master key (128, 192, or 256 bits) and expands it into a key schedule—a series of separate round keys, one for each encryption round plus the initial round.

Think of it like a master key that generates a unique key for each door you must pass through. Each round key is derived from the master but provides independent randomness per round.

How Key Expansion Works

The key expansion algorithm takes the master key and stretches it into enough material for all rounds:

  • AES-128: 10 rounds → needs 11 round keys (128 bits each)
  • AES-192: 12 rounds → needs 13 round keys
  • AES-256: 14 rounds → needs 15 round keys

The expansion process uses:

  • Rotation: Shifting bytes in a word
  • Substitution: Running bytes through the S-box (same one used in SubBytes)
  • XOR operations: Combining words with previous key material and round constants (Rcon)

Each round constant changes per round, ensuring different transformations. The algorithm processes the key in 32-bit words, applying transformations selectively to generate new key material that's cryptographically distinct but deterministically reproducible.

Security Benefit

By using different keys each round, AES prevents patterns from emerging. An attacker can't leverage knowledge of one round key to trivially derive others or the master key—the expansion introduces key avalanche, where changing one bit in the master key affects many bits across all round keys.

Key Takeaway: AES key expansion transforms one master key into multiple round keys through substitution, rotation, and XOR operations, ensuring each encryption round uses independent, unpredictable key material derived deterministically from the original key.