ColdFusion Hash

Viewed 1473

I'm trying to create a password digest with this formula to get the following variables and my code is just not matching. Not sure what I'm doing wrong, but I'll admit when I need help. Hopefully someone is out there who can help.

  • Formula from documentation: Base64(SHA1(NONCE + TIMESTAMP + SHA1(PASSWORD)))

  • Correct Password Digest Answer: +LzcaRc+ndGAcZIXmq/N7xGes+k=

ColdFusion Code:

<cfSet PW = "AMADEUS">
<cfSet TS = "2015-09-30T14:12:15Z">
<cfSet NONCE = "secretnonce10111"> 
<cfDump var="#ToBase64(Hash(NONCE & TS & Hash(PW,'SHA-1'),'SHA-1'))#">

My code outputs:

Njk0MEY3MDc0NUYyOEE1MDMwRURGRkNGNTVGOTcyMUI4OUMxM0U0Qg==

I'm clearly doing something wrong, but for the life of me cannot figure out what. Anyone? Bueller?

1 Answers
Related