2
我MSDN文章設在這裏以下:http://msdn.microsoft.com/en-us/library/aa302398.aspxASP.NET散列PW的+鹽混亂
我的困惑是在功能:
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;
}
我的理解是: 1. CONCAT鹽和純文本pwd 2.使用sha1創建散列傳球 3.再次將鹽與最初含有鹽的散列密碼進行concat?
步驟3背後的推理是什麼? 我發現了一個與MSDN相同的函數,並且它省略了最後一個concat。
我只是不明白爲什麼MSDN版本中有最後一個concat操作。