study_security_l5
"/home/yossef/notes/Su/security/study_security_l5.md"
path: Su/security/study_security_l5.md
- **fileName**: study_security_l5
- **Created on**: 2025-06-02 21:18:49
AES Explained Simply
What is AES?
AES (Advanced Encryption Standard) is a symmetric block cipher that
encrypts data in 128-bit blocks using 128/192/256-bit keys. It was
selected by NIST in 2001 to replace DES.
Key Properties:
- Block size: 128 bits (16 bytes)
- Key sizes: 128/192/256 bits
- Rounds: 10/12/14 (based on key size)
- Fast in both hardware/software
- Resistant to known attacks
How AES Encryption Works
1. Initial Setup
- Plaintext arranged in 4×4 byte matrix (State)
- Key expanded into round keys
2. Initial Round
- AddRoundKey: XOR State with first round key
3. Main Rounds (9/11/13 rounds)
Each round performs:
- SubBytes: Byte substitution using S-box
- ShiftRows: Row shifting
- MixColumns: Column mixing
- AddRoundKey: XOR with round key
4. Final Round
- Same as main rounds but skips MixColumns
Core Operations Explained
SubBytes
- Each byte replaced using S-box table
- Example: Byte
6E
→ Lookup row 6, column E →9F
ShiftRows
- 1st row: unchanged
- 2nd row: 1-byte left shift
- 3rd row: 2-byte left shift
- 4th row: 3-byte left shift
MixColumns
- Matrix multiplication in Galois Field (GF(2⁸))
- Each column mixed with fixed matrix
AddRoundKey
- Simple XOR between State and round key
AES Decryption
Uses inverse operations in reverse order:
- Inverse ShiftRows
- Inverse SubBytes
- AddRoundKey
- Inverse MixColumns (except last round)
Review Questions Explained
1. How AES Works
As described above - processes data through multiple rounds of
substitution, permutation, and mixing operations using expanded
keys. The number of rounds depends on key size.
2. Encryption Example Walkthrough
For the given plaintext row 54 4F 4E 20
:
- AddRoundKey: XOR with first round key
- SubBytes: Replace each byte via S-box
- ShiftRows: Shift row positions
- MixColumns: Matrix multiplication
- Repeat for required rounds
- Final round skips MixColumns
Note: Actual computation requires using the provided S-boxes and
performing GF(2⁸) arithmetic for MixColumns.
Key Points to Remember
-
AES is iterative (repeats rounds)
-
All operations are reversible for decryption
-
Security comes from multiple layers of substitution/permutation
-
Key expansion creates unique round keys
-
Final round differs slightly by omitting MixColumns
continue:./study_security_l6.md
before:./study_security_l4.md