cloak v0.8.0 Cloak.Fields.Date View Source
An Ecto.Type to encrypt Date fields.
Migration
The database field must be of type :binary.
add :encrypted_field, :binaryUsage
Define an Encrypted.Date module in your project:
defmodule MyApp.Encrypted.Date do
  use Cloak.Fields.Date, vault: MyApp.Vault
endThen, define the type of your desired fields:
schema "table_name" do
  field :encrypted_field, MyApp.Encrypted.Date
end