Skip to content

ermogenes/SaltedPassword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SaltedPassword

A simple utility to create and test salted-hash password with PBKDF2/SHA256

Build and deploy to NuGet

Usage

Add the package to your project:

dotnet add package Ermogenes.SaltedPassword
using Ermogenes.SaltedPassword;

Getting a key from a clear password:

string keyToStore = SaltedPassword.GetPersistentKey(clearPassword);

The value of keyToStore is a salted-hash from the clearPassword, and may be stored.

The format:

base64-salt|number-of-iterations|base64-hash

Testing a password for equality:

bool passwordMatch = SaltedPassword.Match(clearPasswordToMatch, storedKey);

Test

git clone https://github.com/ermogenes/SaltedPassword
cd SaltedPassword
dotnet test

Reference

OWASP Password Storage Cheat Sheet

License

MIT License

About

A simple utility to create and test salted-hash password with PBKDF2/SHA256

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages