joe_pool_is
Contributor
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:
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
to compare what they punch in with what I have in the database, but it pukes every time!
Code:
strPwd1 =
FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd1.Text, "sha1");
Code:
strPwd2 =
FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd2.Text, "sha1");
if (strPwd1 == strPwd2) {
// do stuff
} else {
// puke!
}