PC Review


Reply
Thread Tools Rate Thread

Cookie Encryption

 
 
Rodrigo m. Ferreira
Guest
Posts: n/a
 
      19th Aug 2008
Hi,

How do I encrypt information for storing in cookies? I used the MD5, but I
don't know how to decrypt information.
Can you help me?

Rodrigo M. Ferreira

 
Reply With Quote
 
 
 
 
George
Guest
Posts: n/a
 
      19th Aug 2008
"Rodrigo m. Ferreira" <(E-Mail Removed)> wrote in message
news:BDFDD606-581F-494A-98F1-(E-Mail Removed)...
> Hi,
>
> How do I encrypt information for storing in cookies? I used the MD5, but I
> don't know how to decrypt information.
> Can you help me?
>
> Rodrigo M. Ferreira


Guess what ... if you used MD5 to encrypt then you can not decrypt it ...

MD5 is not encryption. It's a hashing algorithm.. It works best with
passwords.

Simple example of hashing algorithm - length of the string.

Let say you have password "TEST" the hash value is 4. So I keep 4 in my
database. Next time you come to the website I am asking you for the
password. You enter "TEST" I get it's hash value 4 and compare it with
database. It's the same you in.

If you do not know password and enter "PASSWORD" I get hash value 7 and it
does not match my database record. Hence access denied.

1. No one knows the password. So nobody, even Database admin can pretend to
be you.
2. more than one password can generate same hash value... Hence inability to
reverse it.

Obviously in our case to many passwords generate the same hash value. So use
MD5 and not my favorite string's length hashing algorithm...

PS: Check out this article if you still want to use MD5
http://www.codeproject.com/KB/database/md5sql2000.aspx

 
Reply With Quote
 
Fred
Guest
Posts: n/a
 
      19th Aug 2008
Dans : news:BDFDD606-581F-494A-98F1-(E-Mail Removed),
Rodrigo m. Ferreira écrivait :
> Hi,


Hello,

> How do I encrypt information for storing in cookies? I used the MD5,
> but I don't know how to decrypt information.
> Can you help me?


You can use FormsAuthentication.Encrypt and FormsAuthentication.Decrypt
Only the server can decrypt what it encrypted.

--
Fred
(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cookie contanier does not correctly parse Set-Cookie header with domain token dav Microsoft Dot NET Framework 2 15th Dec 2010 08:55 AM
SSL encryption lost when cookie passed from client to server Scott Microsoft Dot NET Framework 2 4th Nov 2008 04:26 PM
cookie contanier does not correctly parse set cookie header with domain token dav Microsoft Dot NET Framework 0 12th Aug 2007 09:06 AM
cookie encryption/security =?Utf-8?B?Z2w=?= Microsoft C# .NET 4 23rd Jan 2006 03:36 AM
Any downsides to cookie assignment inside custom class using HttpContext.Current? ASP.NET 2.0 cookie fix? Microsoft ASP .NET 2 17th Aug 2005 07:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:50 AM.