messageAuthenticationCode

Typefunction
Dictionarylibrary.messageauthentication
LibraryMessage Authentication Library
Syntax
messageAuthenticationCode(<message>, <key>, <codeType>)
Associationscom.livecode.library.messageauthentication
Summary

Compute a message authentication code.

Parameters
NameTypeDescription
message

A binary data string.

key

A binary data string.

codeType

The cryptographic hash function to use - "HMAC-SHA3-224": - "HMAC-SHA3-256": - "HMAC-SHA3-384": - "HMAC-SHA3-512": - "HMAC-SHA-224": - "HMAC-SHA-256": - "HMAC-SHA-384": - "HMAC-SHA-512": - "HMAC-SHA-1": Use only for backwards compatibility - "HMAC-MD5": Use only for backwards compatibility

Example
local tHMAC
put messageAuthenticationCode("My Data", "My Secret", "HMAC-SHA-256") into tHMAC
Values
NameTypeDescription
return

Compute a message digest of message

RelatedFunction: messageDigest
Glossary: binary data
Description

messageAuthenticationCode provides a way to check the integrity of information transmitted over or stored in an unreliable medium is a prime necessity in the world of open computing and communications. Mechanisms that provide such integrity check based on a secret key are usually called "message authentication codes" (MAC). Typically, message authentication codes are used between two parties that share a secret key in order to validate information transmitted between these parties. messageAuthenticationCode also uses a secret key for calculation of the message authentication values.