thiamsantos / conceal

Easy encrypt data with AES-CBC-256

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conceal

Build Status

Provides an easy way to encrypt and decrypt a string using the AES-CBC-256 algorithm.

It runs roughly this functions in order to return a encrypt base64-encoded string: base64(iv + aes_cbc256(sha256(key), iv, data))

Installation

The package can be installed by adding conceal to your list of dependencies in mix.exs:

def deps do
  [
    {:conceal, "~> 0.1.1"}
  ]
end

Usage

key = "my_secret_key"
data = "my secret data"
digest = Conceal.encrypt(data, key)

case Conceal.decrypt(digest, key) do
  {:ok, decrypted_data} -> decrypted_data
  :error -> :error
end

The docs can be found at https://hexdocs.pm/conceal.

License

Apache License, Version 2.0 © Thiago Santos

About

Easy encrypt data with AES-CBC-256

License:Other


Languages

Language:Elixir 100.0%