Accessibility

ColdFusion Functions

CF_HMAC

By Tim McCarthy February 25, 2003
1,285 Downloads

Rating = 412 votes


Implements HMAC, a mechanism for message authentication using hash functions as specified in <U><A href="http://www.ietf.org/rfc/rfc2104.txt" target="_blank">RFC 2104</A></U>. HMAC requires a hash function H and a secret key K and is computed as follows:   H(K XOR opad, H(K XOR ipad, data)),   where     ipad = the byte 0x36 repeated 64 times     opad = the byte 0x5c repeated 64 times     data = the data to be authenticated Required parameters: data, key Optional parameters:   data_format: hex = data is in hexadecimal format (default is ASCII text)   key_format: hex = key is in hexadecimal format (default is ASCII text)   hash_function: md5, sha1, sha256, or ripemd160 (default is md5)   output_bits: truncate output to leftmost bits indicated (default is all) Nested custom tags: md5.cfm, ripemd_160.cfm</A></U>, sha_1.cfm, sha_256.cfm Example syntax:   <cf_hmac     data="what do ya want for nothing?"     key="Jefe">   <cf_hmac     data="616263"     data_format="hex"     key="414243"     key_format="hex"     hash_function="sha1"     output_bits="80"> Output variable: caller.digest Note: This version accepts input in both ASCII text and hexadecimal formats. Previous versions did not accept input in hexadecimal format. On March 6, 2002, NIST announced the approval of <U><A href="http://csrc.nist.gov/publications/fips/fips198/fips-198a.pdf" target="_blank">FIPS 198</A></U>, The Keyed-Hash Message Authentication Code (HMAC), which contains the specifications for HMAC. This standard became effective on September 6, 2002.

SUPPORT INFORMATION
Not available

Download

License: Freeware
Cost: Free
OS: All
File format: ZIP | 9.8 KB

Additional extension information

Author: Tim McCarthy
Author website: Not available
Date published: February 25, 2003
Approval: None
Browsers: Internet Explorer ALL | Netscape ALL
Compatible Products(s): ColdFusion 4.5
Encrypted: No

Reviews

1-1 of 1 reviews | Show all reviews


DCwebGuy 07-Jan-08 Rating = 5

I was looking for something to help me generate a signature for Amazon's Mechanical Turk platform, and this worked like a charm. Thanks a million for putting this together!

Add a review

(+) Please log in to submit a review