Interested in improving this site? Please check the To Do page.

Back to Crypt Verbs

crypt.hmacMD5

Keyed-hashing for message authentication using MD5

Syntax

crypt.hmacMD5 (s, key, flTranslate)

Params

  • s, a string.
  • key, a string.
  • flTranslate is an optional boolean parameter, determining the format of the return value.

Returns

A string.

Examples

crypt.hmacMD5 ("Hi There", string.hexStringToBinary ("0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"))

“9294727a3638bb1c13f48ef8158bfc9d”

crypt.hmacMD5 ("what do ya want for nothing?", "Jefe")

“750c783e6ab0b503eaa86e310a5db738”

crypt.hmacMD5 (string.hexStringToBinary
   ("0xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"),
    string.hexStringToBinary ("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"))

“56be34521d144c88dbb8c733f0e8b3f6”

Notes

As defined in Wikipedia, A keyed-hash message authentication code, or HMAC, is a type of message authentication code (MAC) calculated using a cryptographic hash function in combination with a secret key. As with any MAC, it may be used to simultaneously verify both the data integrity and the authenticity of a message. Any iterative cryptographic hash function, such as MD5 or SHA-1, may be used in the calculation of an HMAC; the resulting MAC algorithm is termed HMAC-MD5 or HMAC-SHA-1 accordingly. The cryptographic strength of the HMAC depends upon the cryptographic strength of the underlying hash function and on the size and quality of the key.


Personal Tools