In looking through the docs on machinekey, it's not clear entirely clear how
you would decrypt this, as there are a couple of things going on. Also, the
version of .NET you are using seems to matter.

First is the validation method, which according to your machinekey settings
is SHA1.

SHA1 is a hash algorithm, like MD5, which can't be decrypted. In simple
terms, .NET passes a hash of certain data along with the data, and validates
that it matches to prevent tampering. I don't think this is actually in play
with the cookie encryption, but I am really not sure.

Second is the encryption method, which is used for symetrical encryption of
certain things. By default, AES is the algorithm (in .NET 2.0), but it can
also be DES and Triple DES. The decryption attribute in the machinekey is
new as of .NET 2.0

If you are using .NET 2 or higher, try decrypting in CF using the decrypt()
function, with AES as the algorithm, and your decryptionKey value from your
machinekey config as the key. The validation and encryption algorithms are
mutually exclusive starting in .NET 2.

If using .NET 1 or 1.1, it's really not clear what to use - try AES, but it
seems that the validation setting applies all around, and if set to SHA1,
you may not be able to decrypt at all. You do have 3DES as an option for the
validation attribute, which is a symetrical encryption algorithm (which you
can decrypt), so if you can change your machinekey setting, perhaps try that
and then try decrypting in cf using DESEDE as the algorithm. Also just try
AES for kicks.

Here's the relevant page on MSDN about machine key:
http://msdn2.microsoft.com/en-us/library/ms998288.aspx

I know that's not quite a definitive answer, but hopefully it puts you on
the right path.





On 5/14/07, Venkatesh Raman <[EMAIL PROTECTED]> wrote:
>
> Sorry, It was my mistake. I was trying to read the cookie from a different
> domain. I tried the same decryption key I used in Asp.Net. But still could
> not read the encrypted cookie.
>
> Has anybody done this before?
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278143
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to