0 Replies Latest reply on Sep 21, 2009 1:55 AM by david_spangler

    How to encrypt data SHA-1 / TDES / Base64


      I need to encrypt a piece of data to submit to a remote server. The server requires the following format:


      MAC = Base64(TDES(KEY,SHA-1(DATAITEM)))


      I successfully completed the SHA-1 hash, but cannot get the TDES encryption to match the remote server. The information I have is that it needs to be ripleDES, Fixed Key, DESede/CBC/NoPadding, iv = "00000000"


      The correct data should be like



      So far I'm stuck at

      <cfset string = "test">

      <cfset key = "123456781234567812345678">


      <cfset string_sha = #Hash(string, "SHA")# & "00000000">

      this delivers the proper results


      <cfset string_tdes = #Encrypt(string_sha, key, "DESEDE")#>

      this give me an error with the key, and incorrect data if i create a new key


      <cfset MAC = #ToBase64(string_tdes)#>

      this give a data string way too long to match the correct one.


      i'm totally stumped. any obvious mistakes?


      cheers & thanks for any help.