Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Decrypting A String of Numbers Using ColdFusion decrypt tag

Avatar of billg7
billg7Flag for United States of America asked on
Web ServersColdFusion Language
5 Comments1 Solution760 ViewsLast Modified:
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#
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemariaFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers