Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thiamsantos/conceal
Easy encrypt data with AES-CBC-256
https://github.com/thiamsantos/conceal
Last synced: 4 days ago
JSON representation
Easy encrypt data with AES-CBC-256
- Host: GitHub
- URL: https://github.com/thiamsantos/conceal
- Owner: thiamsantos
- License: other
- Created: 2020-03-02T00:47:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-11T15:45:19.000Z (over 4 years ago)
- Last Synced: 2024-10-12T16:32:03.327Z (about 1 month ago)
- Language: Elixir
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Conceal
[![Build Status](https://github.com/thiamsantos/health_check_plug/workflows/CI/badge.svg)](https://github.com/thiamsantos/health_check_plug/actions)
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`:```elixir
def deps do
[
{:conceal, "~> 0.1.1"}
]
end
```## Usage
```elixir
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](https://hexdocs.pm/conceal).
## License
[Apache License, Version 2.0](LICENSE) © [Thiago Santos](https://github.com/thiamsantos)