Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Certainly, here's a step-by-step example of how AES encryption works, including diagrams to aid

understanding:

**Step 1: Key Expansion**

- AES begins with a secret key that both the sender and receiver know. The key expansion process
generates a set of round keys from the original key.

![AES Key Expansion](https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/AES-Key-


Schedule.svg/500px-AES-Key-Schedule.svg.png)

**Step 2: Initial Round (AddRoundKey)**

- The plaintext is divided into blocks, typically 128 bits (16 bytes). In the initial round, the plaintext is
XORed (bitwise exclusive OR) with the first round key.

![AES Initial Round](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/AES-


AddRoundKey.svg/500px-AES-AddRoundKey.svg.png)

**Step 3: Main Rounds (SubBytes, ShiftRows, MixColumns, AddRoundKey)**

- AES consists of multiple rounds (10, 12, or 14 rounds depending on the key size). Each round performs
a series of operations on the data:

- SubBytes: Bytes in the block are replaced with values from the S-box (substitution box).

![AES SubBytes](https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/AES-SubBytes.svg/
500px-AES-SubBytes.svg.png)

- ShiftRows: Bytes in each row are shifted left by varying offsets.

![AES ShiftRows](https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/AES-ShiftRows.svg/
500px-AES-ShiftRows.svg.png)

- MixColumns: Column-wise mixing operation is applied.

![AES MixColumns](https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/AES-
MixColumns.svg/500px-AES-MixColumns.svg.png)

- AddRoundKey: Round key is XORed with the block.

![AES AddRoundKey](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/AES-
AddRoundKey.svg/500px-AES-AddRoundKey.svg.png)

**Step 4: Final Round**

- The final round omits the MixColumns step and proceeds with SubBytes, ShiftRows, and AddRoundKey.
**Step 5: Ciphertext**

- After all rounds, you have the ciphertext, which is the encrypted form of the original plaintext.

**Decryption** is the reverse process: starting with the ciphertext and applying the inverse operations
in reverse order, using the same round keys, to recover the original plaintext.

This diagrammatic representation demonstrates how AES encryption transforms plaintext into ciphertext
through a series of well-defined operations.

You might also like