Fixing insufficiently protected credentials
Password breakers and crackers are now more powerful than ever with advanced hardware and endless computing resources. Simply hashing the passwords is no longer enough, and it is now crucial to pick the right hashing function to protect the credentials from being exposed when a data breach happens.
In this recipe, we will modify the code that implements a weak hashing function and replace it with BCrypt.
Getting ready
Using Visual Studio Code, open the sample Online Banking app folder at \Chapter03\insufficient-protected-creds\before\OnlineBankingApp
.
How to do it…
Let's take a look at the steps for this recipe:
- Type the following command in a Terminal to build the sample app to confirm there are no compilation errors:
dotnet build
- Open the
\Chapter03\insufficient-protected-creds\before\OnlineBankingApp\Areas\Identity\PasswordHasher.cs
file. ThePasswordHasher
class is derived fromIPasswordHasher
, which...