Search code examples
asp.net-core-mvcasp.net-identityasp.net-core-6.0

Can someone explain to me that the algorithm of the password hash that use in ASP.NET CORE 6 MVC (Identity Entity Framework Core Ver 6.0.8)?


I would like to know the default encrypted algorithm use in this framework and how can I edit to make my own encrypted algorithm by adding some words before the whole password hash generated.


Solution

  • user207421 is absolutely correct: "Encrypting" plaintext (e.g. a password), and generating a password hash are two completely different things.

    I'm not sure what you actually wish to accomplish, or why. But besides the Microsoft documentation, you might find these two links useful:

    Per the first link:

    • 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

    A wise caveat from the second article:

    You should always think carefully before replacing security-related components, as a lot of effort goes into making the default components secure by default. This article solves a specific problem, but you should only use it if you need it!