How envelope encryption works at 42project
Every exchange API key you store is encrypted with a per-record data encryption key (DEK). That DEK is itself encrypted with a key encryption key (KEK) held in a hardware-backed KMS. The DEK is stored alongside the ciphertext; the KEK never leaves KMS. To decrypt a key, an attacker would need both the database AND active KMS credentials AND the ability to call KMS — three independent breaches.