Thanks Paul, I hadn't considered diving into Java to construct the IVector, but
that seems like a good approach, and produces a valid ByteArray. You might be
right about that chr(0) causing problems, though. When I attempt to decrypt,
Coldfusion is throwing this error:
An error occurred while trying to encrypt or decrypt your input string:
Given final block not properly padded.
That's happening whether I set the Algorithm to just 'DESEDE' or to
'DESEDE/ECB/PKCS5Padding'. I'll keep plugging away, and thanks again for the
pointer about the IVector construction.
-Michael
-----Original Message-----
From: Paul Vernon [mailto:[email protected]]
Sent: Tuesday, November 05, 2013 4:01 AM
To: cf-talk
Subject: RE: Need help with decryption from C#
> I've done encryption before, and have been able to successfully send
> the encrypted data to third parties for decryption; but I've never
> been on the other side of the transfer, and the initialization vector
> has me especially confused.
>
Using CF's Decrypt(encrypted_string, key[, algorithm, encoding, IVorSalt,
iterations])
You should be able to do something like this...
Note, this is off the top of my head for TripleDES and I've not tested it in
the slightest. The only thing that really concerns me though is the chr(0) in
the middle of the StringBuffer append sequence. You may have to experiment with
how you build that ByteArray.
sb = createObject("java", "java.lang.StringBuffer"); sb.append(chr(27));
sb.append(chr(9)); sb.append(chr(45)); sb.append(chr(27)); sb.append(chr(0));
sb.append(chr(72)); sb.append(chr(171)); sb.append(chr(54));
IVector = sb.toString().getBytes(); // convert the StringBuffer to a ByteArray
outputString = Decrypt(inputString, Hash(Key, "MD5"), "DESEDE", "Base64",
IVector);
Paul
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357043
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm