Secrex v0.3.0 Secrex.AES View Source

This module is an implementation of Secrex.Cipher using AES256-GCM.

Example

iex> encryption_key = "very-secretive"
iex> {:ok, encrypted} = Secrex.AES.encrypt("Hello, World!", encryption_key)
iex> Secrex.AES.decrypt(encrypted, encryption_key)
{:ok, "Hello, World!"}

Link to this section Summary

Functions

Decrypts data using AES256-GCM

Encrypts data using AES256-GCM.

Link to this section Functions

Link to this function

decrypt(ciphertext, key) View Source
decrypt(Secrex.Cipher.ciphertext(), Secrex.Cipher.key()) ::
  {:ok, Secrex.Cipher.plaintext()}
  | {:error, :invalid_ciphertext | :incorrect_key_or_ciphertext}

Decrypts data using AES256-GCM

Encrypts data using AES256-GCM.