Coder Social home page Coder Social logo

ricardocampos / simplecrypto.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shawnmclean/simplecrypto.net

0.0 2.0 0.0 2.18 MB

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

Home Page: http://www.shawnmclean.com/blog/2012/04/simplecrypto-net-a-pbkdf2-hashing-wrapper-for-net-framework/

License: Other

C# 94.43% Ruby 5.57%

simplecrypto.net's Introduction

NuGet Downloads Build Status Code Coverage

SimpleCrypto.Net

NuGet

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

Description

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

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:

SimpleCrypto.dll

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

License

SimpleCrypto.NET is licensed with the Apache License, version 2.0. You can find more information on the license here: http://www.apache.org/licenses/LICENSE-2.0.html

##Changelog

  1. 0.3.0.0 - March 14, 2013 - Generate Salt feature added.
  2. 0.2.0.0 - September 16, 2012 - Generate Random password feature added.

simplecrypto.net's People

Contributors

shawnmclean avatar ericvf avatar allenp avatar

Watchers

Ricardo Campos avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.