Skip to content
Simple cryptography library that wraps complex hashing algorithms for quick and simple usage.
C# Ruby
Latest commit 50adce7 Aug 26, 2014 @shawnmclean Added badges.

NuGet Downloads Build Status Code Coverage



Visual Studio users can install this directly into their .NET projects by executing the following command in the Package Manager Console

PM> Install-Package SimpleCrypto


Simple cryptography library that wraps complex hashing algorithms for quick and simple usage.


You may download the source and build the project or install it directly from NuGet.

If building the source, please reference the following file in your .net project:


Hash Password Example:

ICryptoService cryptoService = new PBKDF2();

//New User
string password = "password";

//save this salt to the database
string salt = cryptoService.GenerateSalt();

//save this hash to the database
string hashedPassword = cryptoService.Compute(password);

//validate user
//compare the password (this should be true since we are rehashing the same password and using the same generated salt)
string hashedPassword2 = cryptoService.Compute(password, salt);
bool isPasswordValid = cryptoService.Compare(hashedPassword, hashedPassword2);

Generate Random Password Example:

//generate uppercase passwords only
string password = RandomPassword.Generate(PasswordGroup.Uppercase);

//generate both upper case and lower passwords only
string password = RandomPassword.Generate(PasswordGroup.Uppercase, PasswordGroup.Lowercase);

//generate 10 character uppercase passwords only
string password = RandomPassword.Generate(10, PasswordGroup.Uppercase);

Necessary prerequisites

.NET 4


SimpleCrypto.NET is licensed with the Apache License, version 2.0. You can find more information on the license here:


  1. - March 14, 2013 - Generate Salt feature added.
  2. - September 16, 2012 - Generate Random password feature added.
Something went wrong with that request. Please try again.