是否有一个内置的功能,散列.NET密码?有一个、密码、功能、NET

2023-09-03 07:43:23 作者:不讨欢心

我看到了这个问题的http://stackoverflow.com/questions/287517/encrypting-hashing-plain-text-passwords-in-database

,我知道我不应该做的MD5(盐​​+密码);我看到了一个Python实现的解决方案。

and i am aware i shouldnt do md5("salt" + password); and i see an implementation in python for a solution.

有内置的功能与PARAMS一个.NET我可以使用,而不是写我自己?

Is there a .NET built in function with params i can use instead of writing my own?

推荐答案

查看 FormsAuthentication.HashPasswordForStoringInConfigFile

string hashMD5 = FormsAuthentication.HashPasswordForStoringInConfigFile(Pass + Salt, "MD5");

string hashSHA1 = FormsAuthentication.HashPasswordForStoringInConfigFile(Pass + Salt, "SHA1");