Skip to main content

CRYPTO.HMAC

Creates an hash based authentication code (HMAC) for given text and secret. The used hash algorithm can be optionally specified. For a list of supported hash algorithms please refer to Hash Algorithms. The used hash algorithms are from the OpenSSL Library. See their docs for more details.

Syntax

=CRYPTO.HMAC(Text, Secret [, Algorithm])

Arguments

NameDescription
TextA text to create hash value for.
SecretA text used as key to generate the cryptographic HMAC hash.
AlgorithmOptional. The hash algorithm to use. Defaults to "sha256"

Return Value

The hmac value or an Error Code

Example

FunctionResultComment
=CRYPTO.HMAC("hello", "top secret")a28f6aee6a27565bf1b868da1947c35147039fe6482b35d3b8fdeb9592e42e99By default "sha256" is used.
=CRYPTO.HMAC("hello", "top secret", "md5")9ffaf5da07c95deaa000729cd65fefeaSame text and secret as before but creates an hmac using "md5" algorithm.