An Elixir encry
- Generate a shared base64 encoded secret to be used for encryption/decryption
iex> Excrypt.generate_secret
secret = "ld9p1COMK3VogmdlfCVwKw=="
- Encrypt a string with the shared secret
iex> Excrypt.encrypt("Encrypt me!", secret)
encrypted_text = "EyYFA9EoPaZdj4kbzADoUA=="
- Decrypt the string with the shared secret
iex> Excrypt.decrypt(encrypted_text, secret)
"Encrypt me!"
The package can be installed
by adding excrypt
to your list of dependencies in mix.exs
:
def deps do
[
{:excrypt, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc or the docs can be found at https://hexdocs.pm/excrypt.