0Pricing
Cryptology Academy · Lesson

AES Key Expansion & Key Sizes

Explore 128, 192, and 256-bit keys and the key schedule process.

AES Key Expansion & Key Sizes is a free Cryptology Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Welcome

AES expands a short key into multiple round keys through the Key Schedule. Understanding this is essential for grasping how the key permeates every round.

Why Key Expansion?

AES-128 has 10 rounds plus an initial AddRoundKey. That requires 11 round keys × 16 bytes = 176 bytes total. The key schedule expands a 16-byte master key into this full key material.

Key Schedule Words

The key schedule works in 4-byte words. AES-128 starts with 4 words (W[0..3]) from the original key. It generates W[4..43], giving 44 words = 176 bytes = 11 × 128-bit round keys.

SubWord

SubWord applies the AES S-box to each of the 4 bytes in a word independently. It provides nonlinearity in key expansion, preventing related-key attacks.

RotWord

RotWord performs a cyclic left shift on a 4-byte word: [a, b, c, d] → [b, c, d, a] This ensures the same 32-bit word doesn't repeat in key expansion.

Round Constants (Rcon)

Rcon[i] = [2^(i-1), 0, 0, 0] in GF(2^8). XORed into every 4th word during key expansion. Makes each round key different and prevents slide attacks.

Key Expansion Formula

For i ≥ 4: if i % 4 == 0: W[i] = W[i-4] XOR SubWord(RotWord(W[i-1])) XOR Rcon[i/4] else: W[i] = W[i-4] XOR W[i-1]

AES-192 and AES-256 Schedules

AES-192: 6 input words, generates 52 words (12+1 rounds). AES-256: 8 input words, generates 60 words (14+1 rounds). AES-256 adds an extra SubWord every 8th word.

Security of Key Sizes

AES-128 offers 128-bit security (2^128 brute-force). AES-256 offers 256-bit security. For quantum adversaries, AES-256 retains 128-bit security (Grover's algorithm halves it).

Choosing AES Key Size

For most applications today: AES-128 is sufficient. For long-term secrets, classified data, or post-quantum scenarios: AES-256. AES-192 is rarely used in practice.

Key Derivation from Passwords

Never use a password directly as an AES key. Use a KDF: key = PBKDF2(password, salt, 600000, 32, SHA256) or key = Argon2id(password, salt, mem=65536, t=3, p=4).

Quick Check

How many round keys does AES-128 require including the initial AddRoundKey?

Recap

AES key expansion mastered! Next we put it all together and encrypt real files using AES in Python with OpenSSL.

Frequently asked questions

Is the “AES Key Expansion & Key Sizes” lesson free?

Yes — the full text of “AES Key Expansion & Key Sizes” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “AES Key Expansion & Key Sizes”?

Explore 128, 192, and 256-bit keys and the key schedule process. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “AES Key Expansion & Key Sizes” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Symmetric Encryption Concepts
  2. AES Structure: Rounds & State Matrix
  3. AES Key Expansion & Key Sizes
  4. Encrypting Files with AES in Practice
← Back to Cryptology Academy