Cryptography › Module 2 › Lesson 1
Symmetric Encryption (AES)
How AES uses one shared key for fast encryption—and how keys must stay secret
Opening
One key to encrypt, same key to decrypt
AES (Advanced Encryption Standard) is the workhorse of modern symmetric encryption. Disks, VPNs, TLS bulk data, messaging apps—somewhere underneath, a shared secret is often doing the heavy lifting. If that key leaks, confidentiality is gone.
1. Symmetric Model
Alice and Bob share a secret key K. • Encrypt(plaintext, K) → ciphertext • Decrypt(ciphertext, K) → plaintext AES supports key sizes like 128 and 256 bits. Modes of operation (GCM, CBC, etc.) matter; modern systems prefer authenticated encryption (e.g., AES-GCM) so ciphertext cannot be silently tampered with.
2. Strengths & Limits
Fast
Great for large files and high-throughput links.
Key sharing problem
How do Alice and Bob agree on K securely? Often via asymmetric crypto or a prior secret.
Key hygiene
Reuse, hardcoding, or logging keys destroys the whole design.
OpenSSL AES-256-CBC demo (lab only)echo "secret message" > message.txt openssl enc -aes-256-cbc -salt -pbkdf2 -in message.txt -out message.enc openssl enc -d -aes-256-cbc -pbkdf2 -in message.enc -out message.out type message.out
echo "secret message" > message.txt openssl enc -aes-256-cbc -salt -pbkdf2 -in message.txt -out message.enc openssl enc -d -aes-256-cbc -pbkdf2 -in message.enc -out message.out type message.out
Prefer libraries over raw modes
In apps, use high-level crypto APIs that default to authenticated encryption. Misusing CBC IV/nonce reuse is a classic footgun.
Knowledge Check
AES is an example of:
Multiple choice
Knowledge Check
True or False: In symmetric encryption, encryption and decryption use the same secret key.
True or False
Knowledge Check
A major operational challenge with AES is:
Multiple choice