Univrse.Alg.AES_CBC_HMAC (Univrse v0.2.0) View Source

AES_CBC_HMAC algorithm module.

Sign and encrypt messages using AES-CBC symetric encryption, with HMAC message authentication. https://tools.ietf.org/html/rfc7518#section-5.2.2

Link to this section Summary

Functions

Decrypts the cyphertext with the key using the specified algorithm.

Encrypts the message with the key using the specified algorithm. Returns a three part tuple containing the encrypted cyphertext and any headers to add to the Recipient.

Link to this section Functions

Link to this function

decrypt(alg, encrypted, key, opts \\ [])

View Source

Specs

decrypt(String.t(), binary(), Univrse.Key.t(), keyword()) ::
  {:ok, binary()} | {:error, any()}

Decrypts the cyphertext with the key using the specified algorithm.

Accepted options:

  • aad - Ephemeral public key
  • iv - Agreement PartyUInfo
  • tag - Agreement PartyVInfo
Link to this function

encrypt(alg, message, key, opts \\ [])

View Source

Specs

encrypt(String.t(), binary(), Univrse.Key.t(), keyword()) ::
  {:ok, binary(), map()} | {:error, any()}

Encrypts the message with the key using the specified algorithm. Returns a three part tuple containing the encrypted cyphertext and any headers to add to the Recipient.

Accepted options:

  • aad - Ephemeral public key
  • iv - Agreement PartyUInfo