HMAC-SHA512
Table of Contents
Description
The zoho.encryption.hmacsha512 task returns the hash corresponding to the given text generated using the HMAC-SHA512 algorithm.
Syntax
<response> = zoho.encryption.hmacsha512(<key>, <data>, <output_type>);
where:
Params | Data type | Description |
<response> | TEXT | The hash generated using HMAC-SHA512 algorithm. |
<key> | TEXT | The secret key with which the hash needs to be generated. |
<data> | TEXT | The source text whose corresponding hash needs to be computed. |
<output_type> (Optional) | TEXT | The type in which the generated hash needs to be represented. By default, the output type is base64. Allowed values:
|
Example 1: Generate hash in base64 format using the HMAC-SHA512 algorithm
The following script returns the hash generated using the HMAC-SHA512 algorithm for the text - My#New#Password with the key - Use me to generate hash in base64 format:
response = zoho.encryption.hmacsha512("Use me to generate hash", "My#New#Password");
where:
response
"Use me to generate hash"
"My#New#Password"
Example 2: Generate hash in hexadecimal format using the HMAC-SHA512 algorithm
The following script returns the hash generated using the HMAC-SHA512 algorithm for the text - My#New#Password with the key - Use me to generate hash in hexadecimal format:
response = zoho.encryption.hmacsha512("Use me to generate hash", "My#New#Password", "hex");
where:
response
"hex"