Foundations of Security Week10 Lecture
7333 字
37 分钟
Foundations of Security Week10 Lecture
Lecture Outline
- Introduction to the Advanced Encryption Standard (AES)
- Basic characteristics of AES encryption
- AES block size and key sizes
- Subkeys Generations
- AES round transformations
- SubBytes transformation using S-box
- ShiftRows transformation
- MixColumns transformation
Learning Outcomes
By the end of this lecture, students should be able to:
- Explain why AES replaced DES as a modern encryption standard
- Identify the block size and supported key lengths of AES
- Explain how plaintext is represented as a state matrix in AES
- Describe the four main AES transformations (SubBytes, ShiftRows, MixColumns, AddRoundKey)
- Explain how AES encryption rounds operate
Advanced Encryption Standard (AES)
How it works
- Key Expansion: The original key (e.g., 128 bits) is expanded into a set of “round keys” used in each step of the encryption. This ensures the key evolves throughout the process, adding complexity.
- Initial Round: The input data (a 16-byte block) is combined with the first round key using a bitwise XOR operation.
- Main Rounds: It applies a series of transformations to the data in multiple rounds (10 rounds for 128-bit keys, 12 for 192-bit, 14 for 256-bit). Each round consists of four steps:
- SubBytes: Each byte in the block is replaced with another byte according to a predefined substitution table (S-box).
- ShiftRows: The rows of the data block (visualized as a 4x4 grid) are shifted to the left by different amounts.
- MixColumns: The columns of the grid are mixed using a mathematical operation, further scrambling the data.
- AddRoundKey: The current round key is XORed with the block, integrating the key into the process.
- Final Round: The last round skips the MixColumns step but includes SubBytes, ShiftRows, and AddRoundKey to finalize the encryption.

Key Expansion
- Key Expansion takes the original 128-bit key and expands it into a larger set of keys (called round keys) that AES uses in its encryption rounds. Here we will choose key “cdutobufoscourse”
- For AES-128, which uses 10 rounds of encryption, the process generates 11 round keys (one for the initial round and one for each of the 10 main rounds).
- Each round key is 128 bits (16 bytes), so the total expanded key is 176 bytes (11 rounds 16 bytes).


- The original key is 4 words (16 bytes 4 = 4 words).
- The total expanded key is 44 words (11 rounds 4 words per round).
- So, the Key Expansion generates 44 words (labeled to ), where:
to are the original key.
to are derived iteratively.


Function
- RotWord: Performs a one byte left circular shift on a word. This means that an input word transform into .
- SubWord Apply the AES S-box substitution to each byte of the rotated word. This performs a byte substitution on each byte. The first bit represents the row number in S-Box and the second bit represents the column number in S-Box
- Rcon: XOR the result from the subword operation with a round constant (Rcon). This is a fix table.
- RotWord: Performs a one byte left circular shift on a word. This means that an input word transform into .

- SubWord: Apply the AES S-box substitution to each byte of the rotated word. This performs a byte substitution on each byte. The first bit represents the row number in S-Box and the second bit represents the column number in S-Box
W3
75
72
73
65
RotWord
(X1)
(X1)
72
73
65
75
→
| Row | Column |
|---|---|
| 7 | 2 |
| 7 | 3 |
| 6 | 5 |
| 7 | 5 |
→
SubWord
(Y1)
(Y1)
40
8F
4D
9D
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 00 | 63 | 7C | 77 | 7B | F2 | 6B | 6F | C5 | 30 | 01 | 67 | 2B | FE | D7 | AB | 76 |
| 10 | CA | 82 | C9 | 7D | FA | 59 | 47 | F0 | AD | D4 | A2 | AF | 9C | A4 | 72 | C0 |
| 20 | B7 | FD | 93 | 26 | 36 | 3F | F7 | CC | 34 | A5 | E5 | F1 | 71 | D8 | 31 | 15 |
| 30 | 04 | C7 | 23 | C3 | 18 | 96 | 05 | 9A | 07 | 12 | 80 | E2 | EB | 27 | B2 | 75 |
| 40 | 09 | 83 | 2C | 1A | 1B | 6E | 5A | A0 | 52 | 3B | D6 | B3 | 29 | E3 | 2F | 84 |
| 50 | 53 | D1 | 00 | ED | 20 | FC | B1 | 5B | 6A | CB | BE | 39 | 4A | 4C | 58 | CF |
| 60 | D0 | EF | AA | FB | 43 | 4D | 33 | 85 | 45 | F9 | 02 | 7F | 50 | 3C | 9F | A8 |
| 70 | 51 | A3 | 40 | 8F | 92 | 9D | 38 | F5 | BC | B6 | DA | 21 | 10 | FF | F3 | D2 |
| 80 | CD | 0C | 13 | EC | 5F | 97 | 44 | 17 | C4 | A7 | 7E | 3D | 64 | 5D | 19 | 73 |
| 90 | 60 | 81 | 4F | DC | 22 | 2A | 90 | 88 | 46 | EE | B8 | 14 | DE | 5E | 0B | DB |
| A0 | E0 | 32 | 3A | 0A | 49 | 06 | 24 | 5C | C2 | D3 | AC | 62 | 91 | 95 | E4 | 79 |
| B0 | E7 | C8 | 37 | 6D | 8D | D5 | 4E | A9 | 6C | 56 | F4 | EA | 65 | 7A | AE | 08 |
| C0 | BA | 78 | 25 | 2E | 1C | A6 | B4 | C6 | E8 | DD | 74 | 1F | 4B | BD | 8B | 8A |
| D0 | 70 | 3E | B5 | 66 | 48 | 03 | F6 | 0E | 61 | 35 | 57 | B9 | 86 | C1 | 1D | 9E |
| E0 | E1 | F8 | 98 | 11 | 69 | D9 | 8E | 94 | 9B | 1E | 87 | E9 | CE | 55 | 28 | DF |
| F0 | 8C | A1 | 89 | 0D | BF | E6 | 42 | 68 | 41 | 99 | 2D | 0F | B0 | 54 | BB | 16 |
Quiz
- Compute the RotWord (X1) and Subword (Y1) of below.
W3
72
69
6e
67
Waiting…
W3
72
69
6e
67
RotWord
(X1)
(X1)
69
6e
67
72
→
| Row | Column |
|---|---|
| 6 | 9 |
| 6 | e |
| 6 | 7 |
| 7 | 2 |
→
SubWord
(Y1)
(Y1)
F9
9F
85
40
- Rcon: XOR the result Y1 with a round constant (Rcon).
W3
75
72
73
65
RotWord
(X1)
(X1)
72
73
65
75
SubWord
(Y1)
(Y1)
40
8F
4D
9D
⊕
Rcon
(R1)
(R1)
01
00
00
00
g (W3)
| Round | Byte 1 | Byte 2 | Byte 3 | Byte 4 |
|---|---|---|---|---|
| R1 | 01 | 00 | 00 | 00 |
| R2 | 02 | 00 | 00 | 00 |
| R3 | 04 | 00 | 00 | 00 |
| R4 | 08 | 00 | 00 | 00 |
| R5 | 10 | 00 | 00 | 00 |
| R6 | 20 | 00 | 00 | 00 |
| R7 | 40 | 00 | 00 | 00 |
| R8 | 80 | 00 | 00 | 00 |
| R9 | 1B | 00 | 00 | 00 |
| R10 | 36 | 00 | 00 | 00 |
Conversion to Binary
| Hexadecimal | Decimal | Binary (4 bits) |
|---|---|---|
0 | 0 | 0000 |
1 | 1 | 0001 |
2 | 2 | 0010 |
3 | 3 | 0011 |
4 | 4 | 0100 |
5 | 5 | 0101 |
6 | 6 | 0110 |
7 | 7 | 0111 |
8 | 8 | 1000 |
9 | 9 | 1001 |
A | 10 | 1010 |
B | 11 | 1011 |
C | 12 | 1100 |
D | 13 | 1101 |
E | 14 | 1110 |
F | 15 | 1111 |
40 = 0100 00009D = 1001 1101
Key Expansion

Initial Round (AddRoundKey)
Message
128-bits



Main Rounds (Round 1)
Quiz
What are the steps in a main round?
Waiting…
Main Rounds - SubBytes
Each byte in the state matrix/array is replaced using the fixed AES S-box (Substitution box).
For example, a byte like 53 is replaced with ED according to the S-box.
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 00 | 63 | 7C | 77 | 7B | F2 | 6B | 6F | C5 | 30 | 01 | 67 | 2B | FE | D7 | AB | 76 |
| 10 | CA | 82 | C9 | 7D | FA | 59 | 47 | F0 | AD | D4 | A2 | AF | 9C | A4 | 72 | C0 |
| 20 | B7 | FD | 93 | 26 | 36 | 3F | F7 | CC | 34 | A5 | E5 | F1 | 71 | D8 | 31 | 15 |
| 30 | 04 | C7 | 23 | C3 | 18 | 96 | 05 | 9A | 07 | 12 | 80 | E2 | EB | 27 | B2 | 75 |
| 40 | 09 | 83 | 2C | 1A | 1B | 6E | 5A | A0 | 52 | 3B | D6 | B3 | 29 | E3 | 2F | 84 |
| 50 | 53 | D1 | 00 | ED | 20 | FC | B1 | 5B | 6A | CB | BE | 39 | 4A | 4C | 58 | CF |
| 60 | D0 | EF | AA | FB | 43 | 4D | 33 | 85 | 45 | F9 | 02 | 7F | 50 | 3C | 9F | A8 |
| 70 | 51 | A3 | 40 | 8F | 92 | 9D | 38 | F5 | BC | B6 | DA | 21 | 10 | FF | F3 | D2 |
| 80 | CD | 0C | 13 | EC | 5F | 97 | 44 | 17 | C4 | A7 | 7E | 3D | 64 | 5D | 19 | 73 |
| 90 | 60 | 81 | 4F | DC | 22 | 2A | 90 | 88 | 46 | EE | B8 | 14 | DE | 5E | 0B | DB |
| A0 | E0 | 32 | 3A | 0A | 49 | 06 | 24 | 5C | C2 | D3 | AC | 62 | 91 | 95 | E4 | 79 |
| B0 | E7 | C8 | 37 | 6D | 8D | D5 | 4E | A9 | 6C | 56 | F4 | EA | 65 | 7A | AE | 08 |
| C0 | BA | 78 | 25 | 2E | 1C | A6 | B4 | C6 | E8 | DD | 74 | 1F | 4B | BD | 8B | 8A |
| D0 | 70 | 3E | B5 | 66 | 48 | 03 | F6 | 0E | 61 | 35 | 57 | B9 | 86 | C1 | 1D | 9E |
| E0 | E1 | F8 | 98 | 11 | 69 | D9 | 8E | 94 | 9B | 1E | 87 | E9 | CE | 55 | 28 | DF |
| F0 | 8C | A1 | 89 | 0D | BF | E6 | 42 | 68 | 41 | 99 | 2D | 0F | B0 | 54 | BB | 16 |
Main Rounds - ShiftRows
It shifts the bytes in each row of the subbytes result to the left by a specific number of positions.

Main Rounds - Mix Columns
- It transforms each column using matrix multiplication in Galois Field (GF) to ensure that changes to one byte affect all four bytes in the column.
- This multiplication is not traditional matrix multiplication.
- Each column of the state matrix (consisting of 4 bytes) is treated as a 4-byte vector and is multiplied by a fixed 4 4 matrix
- This is done in GF using modulo operations with the irreducible polynomial
Reading Assignment and Optional Group Presentation
Next Lecture
What is a Galois Field?
How to compute addition and multiplication in Galois Field (GF).
支持与分享
如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!
Foundations of Security Week10 Lecture
https://firefly.anka2.top/posts/obu/level5/semester2/fos/week10/lecture/ 相关文章 智能推荐
1
Foundations of Security Week11 Lecture
Foundations of Security Further Advanced Encryption Standard (AES)
2
Foundations of Security Week9 Lecture
Foundations of Security Data Encryption Standard (DES)
3
Foundations of Security Week8 Seminar: Digital Signature
Foundations of Security A digital signature is a cryptographic result attached to data that helps a receiver verify three things: Who sent it, It was not changed, Sender cannot easily deny it
4
Foundations of Security Week8 Lecture
Foundations of Security Data Encryption Standard (DES) algorithm
5
Foundations of Security Week7 Seminar: Password Cracking & Secure Hashing
Foundations of Security Generate & Compare Hashes, Rainbow Tables, Hashing vs Encryption, Dictionary Attack, Salting
随机文章 随机推荐