Thursday, March 22, 2012

Simple encrypt and decrypt

Hello, I am attempting to encrypt a string:

string ID = "myData";
string myEncryptedString = FormsAuthentication.HashPasswordForStoringInConfigFile(ID, "md5")."

My question is: How do I decrypt this string to get the origional value?

Thanks a lot.

Timwell you chose MD5 in your code block, MD5 is a hash algorithm which in turn means its one-way, thusfar impossible to decrypt.

If you need to decrypt the string you need to look into other non-hash encrpytion methods.
Thank you very much. Basically, I am serving a page and the data on the page is based on a querystring. What I would like to do, is to encrypt the querystring. Any suggestions?

Thanks a lot!

Tim
Well my question is does the string really require encrypting? you dont wana be doing work you really dont have to do, but if you must encrpyt this article seems to explain your options well http://www.developer.com/net/net/article.php/1548761

Hope that helps...

0 comments:

Post a Comment