Skip to content

AES Encryption Algorithm Explained: Advanced Encryption Standard Tutorial

What is AES?

AES (Advanced Encryption Standard) is a symmetric-key block cipher adopted by the US NIST in 2001. It replaced DES as the standard encryption algorithm and is widely used worldwide for securing sensitive data.

Key Characteristics

AES Key Sizes and Rounds

The number of rounds depends on the key size:

  • 128-bit key: 10 rounds
  • 192-bit key: 12 rounds
  • 256-bit key: 14 rounds

Basic Terminology

  • Byte: Group of 8 bits
  • Word: 4 bytes = 32 bits
  • State matrix: 4×4 matrix (16 bytes) storing intermediate results during encryption
  • Plaintext: Original message (128 bits = 16 bytes)
  • Ciphertext: Encrypted output (also 128 bits)

State Matrix Structure

The input plaintext is arranged into a 4×4 matrix where each cell contains one byte:

  • 4 rows × 4 columns = 16 bytes total
  • Bytes are filled column-wise (first column, then second, etc.)

Key Expansion

The original cipher key is expanded to generate round keys:

  • A 128-bit key produces 44 words (4 words per round × 10 rounds + 4 initial words)
  • Number of keys generated = number of rounds + 1
  • Each round uses 4 words (one column per word)

AES Encryption Process Overview

  1. AddRoundKey (initial): XOR plaintext with first 4 words (w0-w3)
  2. For each round (except last):
    • SubBytes
    • ShiftRows
    • MixColumns
    • AddRoundKey
  3. Last round (no MixColumns):
    • SubBytes
    • ShiftRows
    • AddRoundKey
  4. Output: 128-bit ciphertext

The Four Transformations

1. SubBytes (Substitution)

  • Each byte is substituted using a fixed 16×16 S-box
  • The S-box provides confusion (non-linear transformation)
  • Input byte's first 4 bits determine row, last 4 bits determine column
  • Output is a new byte from the S-box
  • Same S-box used for all bytes

2. ShiftRows (Permutation)

  • Provides diffusion by shifting rows cyclically to the left
  • Row 0: No shift
  • Row 1: Shift by 1 byte
  • Row 2: Shift by 2 bytes
  • Row 3: Shift by 3 bytes
  • For decryption, inverse ShiftRows shifts to the right

3. MixColumns (Mixing)

  • Each column (4 bytes) is multiplied by a fixed constant matrix
  • Constant matrix:
    [2 3 1 1]
    [1 2 3 1]
    [1 1 2 3]
    [3 1 1 2]
    
  • Output is a new 4×1 column (4 bytes)
  • Provides diffusion across bytes in each column
  • Not performed in the last round

4. AddRoundKey (Key Addition)

  • Simple XOR operation between the state matrix and the round key
  • Each round key is 4 words (16 bytes) arranged as a 4×4 matrix
  • Provides the encryption key's influence

Decryption Process

  • Uses inverse transformations in reverse order
  • Round keys applied in reverse order (start with last round key)
  • Inverse SubBytes, Inverse ShiftRows (right shift), Inverse MixColumns

Why AES is Secure

Keep this summary

Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.

Save to LunaNotes

Or summarise for another video.

32K+ people have turned 65K+ videos into notes

“Very useful tool. I'm using it for the last couple weeks and I'm loving it so far. Makes learning on YouTube a great experience.”
Bhai Chrome Web Store review

This summary and transcript were automatically generated using AI with the Free YouTube transcript summary tool by LunaNotes.

Found this summary useful?

Take it with you. One click puts it in your own LunaNotes library.

Save to LunaNotes

Start taking better notes today with LunaNotes