I am following the MSDN article located here: http://msdn.microsoft.com/en-us/library/aa302398.aspx
My confusion is over the function:
private static string CreatePasswordHash(string pwd, string salt)
{
string saltAndPwd = String.Concat(pwd, salt);
string hashedPwd =
FormsAuthentication.HashPasswordForStoringInConfigFile(
saltAndPwd, "SHA1");
hashedPwd = String.Concat(hashedPwd, salt);
return hashedPwd;
}
My understanding is that: 1. concat the salt and the plain text pwd 2. created a hashed pass using sha1 3. Concat the salt once again with the hashed pwd which originally had the salt in it???
What is the reasoning behind step 3? I found a function identical to the MSDN one else where and it omits the last concat.
I just do not understand why the MSDN version has the last concat operation in there.