Hi Experts,
I'm trying to write a script that will take a 20 digit string of base10 numbers (e.g., 1234-5678-9012-3456-7890) that is encrypted from an 18 digit base10 number (e.g., 123456789012345678) and decrypt back to the original 18 digit number. The 18digit number was encoded with 3DES (DESEDE). The three keys are in hex (e.g., key1=4e4e4e4e4e4e4e4e, key2=4e4e4e4e4e4e4e4e, key3=4e4e4e4e4e4e4e4e - yes I'm aware; this set of keys makes it very insecure and equivalent to single DES, it's just for example). My thinking was that the following code would work, but I was wrong. I'm guessing I have a simple syntax problem or it's passing a bad format and the hex number is not being recognized as an actual hex number, so it may be just setting the variable correctly as a hex that will fixit... Please help and thank you in advance!!
<cfset MyString="12345678901234567890"> *Note: the 20 dig encrypted base 10 number
<cfset MyKey="4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e4e">
<cfset decrypted_text= decrypt(MyString, MyKey, "DESEDE","HEX")>
<CFOUTPUT>#decrypted_text#
Our community of experts have been thoroughly vetted for their expertise and industry experience.