View Source CharonOauth2.Utils.Crypto (CharonOauth2 v0.0.1-beta3)

Encrypt/decrypt data using ChaCha20.

Link to this section Summary

Functions

Decrypt a binary using the provided key and return the plaintext or an error.

Encrypt the plaintext into a binary using the provided key.

Link to this section Functions

@spec decrypt(binary(), binary()) :: {:ok, binary()} | {:error, :decryption_failed}

Decrypt a binary using the provided key and return the plaintext or an error.

@spec encrypt(binary(), binary()) :: binary()

Encrypt the plaintext into a binary using the provided key.