I've been tasked with decrypting 3-DES encrypted strings provided by a 
programmer who is using C#.  He provided me with a sample of how he performs 
decryption in C#, and I've been banging my head against the wall trying to 
figure out how to translate this into CF.  I've changed the details of the key 
he provided.

----
private string Key = "N@5q";
private readonly byte[] IVector = new byte[8] { 27, 9, 45, 27, 0, 72, 171, 54 };

  private string Decrypt(string inputString)
  {
        try
        {
            byte[] buffer = Convert.FromBase64String(inputString);
            TripleDESCryptoServiceProvider tripleDes = new 
TripleDESCryptoServiceProvider();
            MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider();
            tripleDes.Key = MD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(Key));
            tripleDes.IV = IVector;
            ICryptoTransform ITransform = tripleDes.CreateDecryptor();
            return 
Encoding.ASCII.GetString(ITransform.TransformFinalBlock(buffer, 0, 
buffer.Length));
        }
        catch (Exception ex)
        { return ""; }

    }
----

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.  

Any help would be much appreciated.

Thanks,
Michael


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:357019
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to