This repository contains solutions to the SEED Encryption/Cryptography Lab assignment, focusing on encryption concepts, common mistakes, and cryptanalysis.
This lab covers key concepts in secret-key encryption, such as AES encryption modes, frequency analysis, padding, and common mistakes involving IV (initial vector) reuse. The tasks demonstrate how encryption vulnerabilities can be exploited and provide hands-on experience with writing crypto-related programs.
- Frequency Analysis: Breaking a monoalphabetic substitution cipher using frequency analysis.
- Encryption with Different Ciphers and Modes: Testing AES-128 in various encryption modes, including CBC and CFB, with different cipher algorithms.
- ECB vs. CBC Modes: Encrypting an image with ECB and CBC to observe visual differences and vulnerabilities.
- Padding Analysis: Investigating PKCS#5 padding in ECB, CBC, and other encryption modes.
- Error Propagation in AES: Understanding how corruption in ciphertext affects recoverability based on different encryption modes.
- Initial Vector (IV) Attacks:
- 6.1. IV Experiment: Exploring the necessity of unique IVs by encrypting the same plaintext with different IVs.
- 6.2. Reusing the Same IV: Demonstrating the weaknesses introduced by IV reuse in OFB and CFB modes.
- 6.3. Predictable IV Attack: Exploiting predictable IVs to reveal Bob’s secret message using AES-CBC encryption.
- Programming to Find the Key used for encryption: Find out the encryption key used in a message using a pre-defined dictionary.
The lab uses a Docker-based environment to simulate encryption oracles and execute chosen-plaintext attacks. The environment is easy to set up with the provided Docker commands.
Here’s the completed section with a bit more context:
# Build the Docker containers as defined in docker-compose.yml
$ docker-compose build
# Start the containers in the background (detached mode)
$ docker-compose up -d
$ docker-compose down
This setup ensures the environment is properly built, launched, and cleaned up afterward.