How Cloak's core abstractions work
masterCloak relies on three main architectural pillars:
- Vaults: These are modules you define in your application and add to your supervision tree. You can run multiple vaults simultaneously, which is useful for umbrella apps or multi-tenant environments.
- Random IVs: Cloak automatically generates unique Initialization Vectors (IVs) using
:crypto.strong_rand_bytesand includes them in the ciphertext. This simplifies storage as you don't need to manage IVs separately. - Tagged Ciphertext: Every ciphertext includes metadata about the algorithm and key used. This enables automatic selection of the correct decryption parameters and simplifies key rotation, as the system can distinguish between old and new ciphertexts.