Advanced Encryption Standard (AES)
Abstract
The Advanced Encryption Standard (AES) is a symmetric block cipher standardized by the U.S. National Institute of Standards and Technology (NIST) in 2001 (FIPS PUB 197). It is the de facto standard for encrypting electronic data and is widely used in government, industry, and consumer applications. AES replaces the older Data Encryption Standard (DES) and is designed to be efficient in both hardware and software implementations, providing strong security assurance for sensitive data.AES operates on fixed-size blocks (128 bits) and supports key sizes of 128, 192, or 256 bits, offering a trade-off between security strength and computational performance. Its design is based on a substitution-permutation network (SPN), involving a series of well-defined transformation rounds that ensure confusion and diffusion of the input plaintext, making it resistant to known cryptanalytic attacks.
Detailed Sections
1. Background and History
- Purpose: AES was developed to replace DES, which had become vulnerable due to its short key length.
- Development: The AES selection process was an open international competition, eventually selecting the Rijndael algorithm by Joan Daemen and Vincent Rijmen.
- Standardization: AES was published as Federal Information Processing Standards Publication (FIPS) 197 in November 2001.
2. Algorithm Overview
a. Block and Key Sizes
- Block Size: Fixed at 128 bits (16 bytes).
- Key Sizes: 128, 192, or 256 bits (16, 24, or 32 bytes).
- Number of Rounds:
- 10 rounds for 128-bit keys
- 12 rounds for 192-bit keys
- 14 rounds for 256-bit keys
b. High-Level Structure
AES encryption and decryption consist of the following operations:- Initial AddRoundKey
- (Nr - 1) Main Rounds: Each round includes:
- SubBytes (byte substitution via S-box)
- ShiftRows (row-wise permutation)
- MixColumns (column-wise mixing transformation)
- AddRoundKey (XOR with round key)
- Final Round: Same as main rounds but omits MixColumns.
3. AES Components
a. SubBytes (Substitution Layer)
- Applies a nonlinear substitution table (S-box) to each byte of the state.
- S-box is constructed to be resistant to linear and differential cryptanalysis.
b. ShiftRows (Permutation Layer)
- Cyclically shifts the rows of the state array by offsets (0, 1, 2, and 3 bytes) to the left.
- Provides inter-column diffusion.
c. MixColumns (Mixing Layer)
- Each column of the state is transformed using matrix multiplication in the Galois Field GF(2^8).
- Ensures diffusion and inter-byte mixing.
d. AddRoundKey (Key Addition Layer)
- Each byte of the state is combined with the round key using bitwise XOR.
- Round keys are derived from the original cipher key via key schedule.
e. Key Schedule
- The cipher key is expanded into an array of key schedule words.
- Uses round constants and S-box for diffusion and nonlinearity.
4. Modes of Operation
AES by itself only encrypts single 128-bit blocks. For practical encryption of longer data, block cipher modes of operation are used:- ECB (Electronic Codebook): Each block is encrypted independently. Not recommended due to pattern leakage.
- CBC (Cipher Block Chaining): Each plaintext block is XORed with the previous ciphertext block before encryption.
- CFB (Cipher Feedback): Converts block cipher into a self-synchronizing stream cipher.
- OFB (Output Feedback): Converts block cipher into a synchronous stream cipher.
- CTR (Counter Mode): Turns block cipher into a stream cipher by encrypting successive values of a counter.
5. Security Considerations
- Key Length: Longer keys (192 or 256 bits) increase brute-force resistance.
- Side-Channel Attacks: Implementations must be hardened against timing and cache attacks.
- IV/Nonce Use: Never reuse IVs/nonces in CBC, CTR, or GCM modes.
- Padding: For block modes (except stream-like modes), data must be padded (e.g., PKCS#7).
6. Implementation Notes
- Hardware and Software: AES is efficient in both contexts. Many CPUs now provide AES hardware instructions (e.g., Intel AES-NI).
- Libraries: Common implementations include OpenSSL, Crypto++, and platform-specific APIs.
- Testing: Standard test vectors are published in FIPS 197.
7. Sample AES Pseudocode (ECB Mode)
plaintext
Code:
function AES_Encrypt_Block(plaintext, key):
state = plaintext
round_keys = KeyExpansion(key)
state = AddRoundKey(state, round_keys[0])
for round = 1 to Nr-1:
state = SubBytes(state)
state = ShiftRows(state)
state = MixColumns(state)
state = AddRoundKey(state, round_keys[round])
state = SubBytes(state)
state = ShiftRows(state)
state = AddRoundKey(state, round_keys[Nr])
return state
8. Typical Use Cases
- File and disk encryption (e.g., BitLocker, VeraCrypt)
- TLS/SSL encrypted communications
- Secure messaging apps
- VPN technologies
- Encrypted storage (e.g., encrypted databases)
9. References
- FIPS PUB 197: Advanced Encryption Standard (AES)
- NIST AES Home
- Wikipedia: Advanced Encryption Standard
Summary Table
| Property | Value/Description |
|---|---|
| Block size | 128 bits |
| Key sizes | 128, 192, 256 bits |
| Rounds | 10, 12, or 14 |
| Standard | FIPS 197 |
| Security margin | Considered strong (as of 2025) |
| Applications | Wide (file, communication, storage, etc) |
Conclusion
AES is a highly secure, efficient, and widely adopted encryption standard. Its design and standardization process ensure trust and broad applicability. For any system requiring strong symmetric encryption, AES in a secure mode of operation remains the preferred choice.If you want to see AES implemented from scratch, i have both C and C++ codes at my cryptography repository, there you will find fully working AES code(C and C++), by looking at the code and how it is implemented and writing your own AES from scratch, you will seriously learn how AES works in detail, in case that's what you want, this is the repository: Learn AES here!