Choose where you’d like to start

HMAC-SHA512

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:

ParamsData typeDescription

<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:

  • base64 - returns the hash in base64 format
  • hex - returns the hash in hexadecimal format
  • binary - returns the hash in binary format

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
The TEXT that represents the hash value returned by this task. Here, the hash returned is fFalDr8XbmROiuumTKy42UgjPYTMbSR3iguegpoHFiqYp+6/5ZeehG0yW43m8BrFRn/g7qe0jTM3JhJQzVEs4Q==.
"Use me to generate hash"
The TEXT that represents the secret key with which the hash is generated.
"My#New#Password"
The TEXT that represents the source text whose corresponding hash needs to be computed.

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
The TEXT that represents the hash value returned by this task. Here, the hash returned is 7c56a50ebf176e644e8aeba64cacb8d948233d84cc6d24778a0b9e829a07162a98a7eebfe5979e846d325b8de6f01ac5467fe0eea7b48d3337261250cd512ce1.
"hex"
The TEXT that represents the output type of the hash. Here, the hash is represented in hexadecimal format.

Related Links

Get Started Now

Execute