Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I found a neat little command for encrypting passwords on my forms before storing them in my databases: HashPasswordForStoringInConfigFile, and I use it as such:
strPwd1 = 
FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd1.Text, "sha1");

This does a wonderful job of turning any password into a large string of garble, but how do I convert it back into something usable so that I can compare my Visitors' passwords with what I have stored? I tried using

strPwd2 = 
FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd2.Text, "sha1");
if (strPwd1 == strPwd2) {
// do stuff
} else {
// puke!
}

to compare what they punch in with what I have in the database, but it pukes every time!

Posted

Hashing

 

Ah! Okay' date=' I guess that makes sense. Thanks.[/quote']

 

I think hashing makes perfect sense if you wish to protect your customers from your own employees. PHP has a similar function.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...