.Net Identity 和.Net Core Identity 哈希算法的区别
Difference in hashing algorithms of .Net Identity and .Net Core Identity
我有两个使用 .Net Framework 和 .Net Core 的项目,它们都使用相同的数据库。
数据库包含用于登录和角色管理的用户详细信息,这分别在 .Net Identity 和 .Net Core Identity 中完成。
登录时,两个应用程序的 UserManager
都在使用输入的电子邮件获取用户,但我在一个应用程序上得到的密码不正确。
所以我想知道.Net Identity 和.Net Core Identity 在密码哈希算法的选择上是否有区别。
检查this blog post,看来默认算法确实不同
The default implementation in the Identity framework is the PasswordHasher class (source code). This clas[sic] is designed to work with two different hashing formats:
- ASP.NET Identity Version 2: PBKDF2 with HMAC-SHA1, 128-bit salt, 256-bit subkey, 1000 iterations
- ASP.NET Core Identity Version 3: PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, 10000 iterations
强调我的
尽管它们都使用 PBKDF2,但存在一些细微差别
我有两个使用 .Net Framework 和 .Net Core 的项目,它们都使用相同的数据库。
数据库包含用于登录和角色管理的用户详细信息,这分别在 .Net Identity 和 .Net Core Identity 中完成。
登录时,两个应用程序的 UserManager
都在使用输入的电子邮件获取用户,但我在一个应用程序上得到的密码不正确。
所以我想知道.Net Identity 和.Net Core Identity 在密码哈希算法的选择上是否有区别。
检查this blog post,看来默认算法确实不同
The default implementation in the Identity framework is the PasswordHasher class (source code). This clas[sic] is designed to work with two different hashing formats:
- ASP.NET Identity Version 2: PBKDF2 with HMAC-SHA1, 128-bit salt, 256-bit subkey, 1000 iterations
- ASP.NET Core Identity Version 3: PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, 10000 iterations
强调我的
尽管它们都使用 PBKDF2,但存在一些细微差别