View Source Charon.Utils.Crypto (Charon v2.7.0)
Encrypt/decrypt, sign/verify, secure compare binaries etc.
Link to this section Summary
Functions
Constant time memory comparison for fixed length binaries, such as results of HMAC computations.
Decrypt a binary using the provided key and return the plaintext or an error.
Encrypt the plaintext into a binary using the provided key.
Calculate a HMAC of data using key. The algorithm is sha256.
Generate a random URL-encoded string of byte_size
bytes.
Link to this section Functions
Constant time memory comparison for fixed length binaries, such as results of HMAC computations.
Returns true if the binaries are identical, false if they are of the same length but not identical. The function raises an error:badarg exception if the binaries are of different size.
Decrypt a binary using the provided key and return the plaintext or an error.
Encrypt the plaintext into a binary using the provided key.
Calculate a HMAC of data using key. The algorithm is sha256.
@spec random_url_encoded(pos_integer()) :: binary()
Generate a random URL-encoded string of byte_size
bytes.