ASP.NET Membership C# - How to compare existing password/hash

后端 未结 2 1870
面向向阳花
面向向阳花 2021-01-01 07:31

I have been on this problem for a while. I need to compare a paasword that the user enters to a password that is in the membership DB. The password is hashed and has a salt.

2条回答
  •  孤独总比滥情好
    2021-01-01 07:56

    So much work! Microsoft makes life much easier with HashPasswordForStoringInConfigFile:

    string myhash = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password + salt, "SHA1");
    

提交回复
热议问题