EctoBase64 Custom Ecto type to base64 {en,de}code binary data in your database. Installation def deps do [ {:ecto_base64, "~> 0.1.0"} ] end Usage schema "users" do field :totp_secret, EctoBase64 end