Skip to content

pombreda/Ensues.Security

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ensues.Security

Password algorithm for .NET

Ensues.Security contains a password algorithm that allows new passwords to be made more robust while not affecting old passwords.

PasswordAlgorithm defaults to using the SHA-256 HashAlgorithm and 1000 key-stretching iterations. If requirements change, the HashAlgorithm and number of key-stretching iterations can change without having to alter previously created passwords or use a database schema. This is possible because information about how the password hash was created is stored in the encoded password itself.

Ensues.Security uses NUnit for unit tests.

Install-Package Ensues.Security

Usage

var pa = new PasswordAlgorithm();

var computedResult_1 = pa.Compute("my password");
pa.Compare("my password", computedResult_1);            // Returns true.

pa.SaltLength = 64;
pa.HashFunction = HashFunction.SHA512;
pa.HashIterations = 10000;

var computedResult_2 = pa.Compute("another password");  // Creates an encoded password hash using a
                                                        // longer salt, a stronger hash function, and
                                                        // more key-stretching iterations than before.

pa.Compare("my password", computedResult_1);            // Still returns true, because the previous
                                                        // salt length, hash function, and key-stretching
                                                        // iterations are stored in computedResult_1.

About

Password algorithm for .NET

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 88.0%
  • Python 12.0%