aes256_crypter v0.1.0 Aes256Crypter

Aes 256 encryption/decryption using Key Derivation with salt implementation in Elixir.

Link to this section Summary

Functions

Returns the Plaintext decrypted with Aes 256 in CBC mode

Returns ciphertext that is encrypted with Aes 256 in CBC mode and encodeed with base64

Returns the generated random salt in byte array

Returns the generated random secret key encoded with Base64

Link to this section Functions

Link to this function decryption(ciphertext, derivation_key, salt, iterations)

Returns the Plaintext decrypted with Aes 256 in CBC mode.

Examples

iex> salt = <<1,2,3,4,5,6,7,8>>
iex> Aes256Crypter.decryption("6yw/4J05fMjPaWQFtSScCKGAhlvnyHle94qxs4fQDck=", "key", salt, 1000)
"This is plaintext"
Link to this function encryption(plaintext, secret_key, salt, iterations)

Returns ciphertext that is encrypted with Aes 256 in CBC mode and encodeed with base64.

Examples

iex> salt = <<1,2,3,4,5,6,7,8>>
iex> Aes256Crypter.encryption("This is plaintext", "key", salt, 1000)
"6yw/4J05fMjPaWQFtSScCKGAhlvnyHle94qxs4fQDck="
Link to this function generate_salt(salt_size \\ 32)

Returns the generated random salt in byte array.

Link to this function generate_secret_key(key_size \\ 32)

Returns the generated random secret key encoded with Base64.