A simple toolkits for keeping password security
$ dotnet add package SecurityPasswordThe salted password is used to encrypt the user password. In order to prevent the encrypted password from being guessed, the Salt processing is added after the encrypted password, so that the same password will generate a different encrypted content each time
| Name | Version | Downloads |
|---|---|---|
| SecurityPassword | ||
| SecurityPassword.DependencyInjection |
The plain text password is hashed by SHA-256. Then we add a salt to the password and hash it again. This salt will be at the front of the hash.
graph LR
Password:123456 --> 7c4a8d09c... --> 32787a9c9... --> 32787a9c9...+Salt
Salt--> 32787a9c9...
Add nuget reference
PM> Install-Package SecurityPassword
add these code to your project
// Encrypt the password
var saltedPasswordService = new SaltedPasswordService();
var encryption = saltedPasswordService.CreatePassword("ThisIsThePassword");
// Verify the password
var result = saltedPasswordService.VerifyPassword("ThisIsThePassword", encryption);