Asp.net身份密码散列

前端之家收集整理的这篇文章主要介绍了Asp.net身份密码散列前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
新的ASP.net身份项目带来了一些有用的代码和网站安全的接口。要实现使用接口的自定义系统(而不是使用MVC 5模板中包含的标准实体框架实现),需要IPasswordHasher。

ASP.net Identity中的IPasswordHasher接口

@H_301_4@namespace Microsoft.AspNet.Identity { public interface IPasswordHasher { string HashPassword(string password); PasswordVerificationResult VerifyHashedPassword(string hashedPassword,string providedPassword); } }

是否可以使用密码盐化在ASP.net身份和通过此接口更安全的加密?

解决方法

“Is it possible to use password salting for more secure encryption in
ASP.net Identity and via this interface?”

是的,该接口提供了已经存在于Core框架中的PasswordHasher的新实现。

另请注意,默认实现已使用Salt Bytes。

创建自定义PasswordHasher(例如MyPasswordHasher)后,您可以像userManager.PasswordHasher = new MyPasswordHasher()一样将其分配给UserManager实例,

See one example of such IPasswordHasher

To implement a custom system using the interfaces (instead of using the standard Entity Framework implementation included in the MVC 5 template) an IPasswordHasher is required.

为了实现EF的备用系统, – 您将实现所有Core接口。 – 不需要IPasswordHasher实现。 PasswordHasher已经在Core框架中提供,因为它是实现。

原文链接:https://www.f2er.com/aspnet/254286.html

猜你在找的asp.Net相关文章