Milestone 5: Secure Hybrid Encrypted Vault
Project Scenario and Mission Briefing
You are stationed in the VoidX Incident Room. A high-value intelligence cache containing sensitive logs has been recovered, but the contents are currently exposed. Your mission is to implement a hybrid encryption vault that protects these files by utilizing RSA-2048 to securely distribute an AES-256-GCM symmetric key.
The vault operates by generating a temporary AES key, using the recipient's public RSA key to encrypt that symmetric key, and then using the symmetric key to encrypt the sensitive payload with Galois/Counter Mode (GCM) for authenticated encryption.
# Target Ciphertext Input: # payload = b'SECRET_VOIDX_DATA_001' # Expected Output: 'Encrypted payload length: 33 bytes'
Implementation of Authenticated Encryption
Your secondary objective is to implement the file encryption mechanism. You must use AES-GCM, which provides both confidentiality and data integrity (authentication). This ensures that if the ciphertext is tampered with, the decryption process will fail.
Ensure the output vault file contains the following structure: [Encrypted AES Key Length (4 bytes)] + [Encrypted AES Key] + [Nonce (12 bytes)] + [Ciphertext + Tag].
# Target Key Size: # key_len = 32 # 256 bits # Expected Output: 'AES Key Generated: 32 bytes'
Objectives & Tasks
Review the tasks below and follow the interactive instructions to complete this module.
Knowledge Check
Ready to test your understanding of Milestone 5: Secure Hybrid Encrypted Vault?