cloak v0.9.0 API Reference

Modules

Cloak makes it easy to encrypt and decrypt database fields using Ecto. It consists of four components

A behaviour for encryption/decryption modules. Use it to write your own custom 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

Defines a list of fields to use as a cursor when migrating a schema’s table to a new encryption key using mix cloak.migrate

An Ecto.Type to encrypt a binary field

An Ecto.Type to encrypt Date fields

An Ecto.Type to encrypt a float field

A custom Ecto.Type for hashing fields using :crypto.hmac/3

An Ecto.Type to encrypt integer fields

An Ecto.Type to encrypt a list of integers

An Ecto.Type to encrypt maps

A custom Ecto.Type for deriving a key for fields using PBKDF2

An Ecto.Type which hashes the field value using the SHA256 algorithm

An Ecto.Type to encrypt a list of strings

An Ecto.Type to encrypt Time fields

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

Mix Tasks

Migrates a schema table to a new encryption cipher