cloak v1.0.0 API Reference

Modules

Cloak consists of two behaviours

A behaviour for encryption/decryption modules. You can rely on this behaviour to create your own Cloak-compatible cipher modules

A Cloak.Cipher which encrypts values with the AES cipher in CTR (stream) mode. Internally relies on Erlang’s :crypto.stream_encrypt/2

A Cloak.Cipher which encrypts values with the AES cipher in GCM (block) mode. Internally relies on Erlang’s :crypto.block_encrypt/4

DEPRECATED version of the Cloak.Ciphers.AES.CTR cipher, for use in migrating existing data to the new format used by Cloak.Ciphers.AES.CTR

DEPRECATED version of the Cloak.Ciphers.AES.GCM cipher, for use in migrating existing data to the new format used by Cloak.Ciphers.AES.GCM

Encrypts and decrypts data, using a configured cipher

Exceptions

Raised when there is invalid configuration

Indicates that no cipher was found to encrypt/decrypt a given text