Is Asp.net identity hashing Secured?

孤街浪徒 提交于 2019-12-08 11:44:49

问题


I have referred the following sites for the Rijndael and Asp.net hashing implementations in the following url.

  1. Rijndael - How to generate Rijndael KEY and IV using a passphrase?
  2. Asp.net hashing - ASP.NET Identity default Password Hasher, how does it work and is it secure?

In both the implementation, The following is used to get the random bytes for the password. RijnDael

Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(password, SALT);

Asp.net Identity hashing

Rfc2898DeriveBytes bytes = new Rfc2898DeriveBytes(providedPassword, salt, HasingIterationsCount)

After the above code, RijnDael applies the encryption for the returned bytes. But asp.net identity copy the result as it is with the salt byte array and return the hashed keys.

Here I had a confusion. RijnDael and Asp.net identity hashing uses the same Rfc2898DeriveBytes.

When RijnDael can decrypt the encrypted keys (which is done with the help of Rfc2898DeriveBytes), why can we do to decrypt the Asp.net Identity hashed keys?

Is there any possibility to do that? Is Asp.net identity secured?


回答1:


Yes, ASP.NET's password hashing method is secure.

In the example you provided, the user is using an encryption technique known as Advanced Encryption Standard (AES, also known as Rijndael). This is why the secret can be decrypted.

The user only uses the Rfc2898DeriveBytes class in order to get a key and an initialisation vector.

The class is not used to hash the secret message. The encryption is what hides the message.

ASP.NET uses the Rfc2898DeriveBytes class to hash a password. This procedure cannot be reversed.



来源:https://stackoverflow.com/questions/40012839/is-asp-net-identity-hashing-secured

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!