.net - Difference in hashing algorithms of .Net Identity and .Net Core Identity
问题描述
I have two projects with .Net Framework and .Net Core, both use same database.
The database has user details for login and role management and that's done in .Net Identity and .Net Core Identity respectively.
When logging in, both application's UserManager
s are fetching user with the entered email, but I get incorrect password on one application.
So I want to know whether is there any difference in choice of password hashing algorithm in .Net Identity and .Net Core Identity.
解决方案
检查this blog post,看起来默认算法确实不同
Identity 框架中的默认实现是 PasswordHasher 类(源代码)。这个类[原文如此] 旨在使用两种不同的散列格式:
- ASP.NET Identity 版本 2:带有HMAC-SHA1 的PBKDF2,128位盐,256 位子密钥,1000 次迭代
- ASP.NET Core Identity 版本 3:带有HMAC-SHA256 的 PBKDF2,128位 salt,256 位子密钥,10000 次迭代
强调我的
虽然它们都使用 PBKDF2 有一些细微的差别
推荐阅读
- mysql - 给定的 sql 语句是否容易受到 sql 注入攻击?
- sapui5 - 将过滤器应用于 Sap.m.Input 的建议项时删除输入值
- json - 如何使用包含 JSON 作为字符串的多态字段解析 POJO?
- bash - Bash“如果数组中的数字”也考虑部分匹配。如何解决这个问题?
- json - Spring Boot Jackson - 根据深度选择性序列化嵌入式对象属性
- android - 如何从 sdcard 中文件的 URI 获取真实路径?
- ios - 强制 UIPickerView 重新加载数据
- c# - 将 WebAssembly Blazor 转换为托管的
- reactjs - 是什么导致转换在 React.js 中不起作用?
- apache-flink - flink 何时使用 timewindowAll