LassoScript Utility
Basics Browse Detail

[Encrypt_HMAC]

Tag Link [Encrypt_HMAC] Category Encryption
Type Substitution Source Available Yes
Support Preferred Version 8.5.1
Change New Data Source Any
Output Type None Security None
Implementation LDML Sets Lasso 8.5

Description

[Encrypt_HMAC] generates a keyed hash message authentication code for a given input and password. The tag requires a -Password parameter which specifies the key for the hash and a -Token parameter which specifies the text message which is to be hashed. These parameters should be specified as a string or as a byte stream.

The digest algorithm used for the hash can be specified using an optional -Digest parameter. The digest algorithm defaults to MD5. SHA1 is another common option. However, any of the digest algorithms returned by [Cipher_List: -Digest] can be used.

The output is a byte stream by default. -Base64 specifies the output should be a Base64 encoded string. -Hex specifies the output should be a hex format string like 0x0123456789abcdef. -Cram specifies the output should be in a cram hex format like 0123456789ABCDEF.

Note that [Encrypt_CramMD5] is equivalent to using this tag with the parameters -Digest='MD5' and -Cram.

Syntax

[Encrypt_HMAC: 'password', 'token']

[Encrypt_HMAC: 'password', 'token', -Digest='sha1']

[Encrypt_HMAC: 'password', 'token', -Digest='sha1', -Base64]

Parameters

Required Parameters
-Password Specifies the key for the hash.
-Token Specifies the text message which is to be hashed.
Optional Parameters
-Digest Specifies the algorithm to use for the hash (usually MD5 or SHA1).
-Base64 Specifies the output should be a Base64 encoded string.
-Hex Specifies the output should be a hex format string 0x0123456789abcdef.
-Cram Specifies the output should be in a cram hex format 0123456789ABCDEF.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.