ExAws.S3.Crypto.AESGCMCipher (ex_aws_s3_crypto v3.2.0)

View Source

This module wraps the logic necessary to encrypt / decrypt using AES GCM.

See the Erlang docs for crypto_one_time_aead for more info.

Summary

Functions

Decrypt the given contents with the supplied key and initialization vector.

Encrypt the given contents with the supplied key.

Functions

decrypt(key, contents, iv)

@spec decrypt(key :: bitstring(), contents :: bitstring(), iv :: bitstring()) ::
  {:ok, unencrypted_result :: binary()} | {:error, reason :: String.t()}

Decrypt the given contents with the supplied key and initialization vector.

encrypt(key, contents)

@spec encrypt(key :: bitstring(), contents :: binary()) ::
  {:ok, {encrypted_result :: bitstring(), initialization_vector :: bitstring()}}
  | {:error, reason :: String.t()}

Encrypt the given contents with the supplied key.