- Generate a random encrypted string as Salt
- Append the Salt to the Password
- Generate a Hash from the combined string
- Store the Hash and Salt to the database. Do not store the password.
- Fetch the Hash and Salt of that particular user
- Append the Salt to the input password
- Generate a new Hash from the combined string
- Compare the new Hash with existing Hash. If matched, then password is same and user is authenticated.
.NET Core
C#