C# Class AuthenticationExample.Web.Controllers.Cryptography

显示文件 Open project: pebblecode/AppHarbor.Web.Security

Public Methods

Method Description
Hash ( string password, int iterations = 100000 ) : string
RandomString ( int length, string allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ) : string
Verify ( string hashedPassword, string password ) : bool

Private Methods

Method Description
ByteArraysEqual ( byte a, byte b ) : bool

Method Details

Hash() public static method

public static Hash ( string password, int iterations = 100000 ) : string
password string
iterations int
return string

RandomString() public static method

public static RandomString ( int length, string allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ) : string
length int
allowedChars string
return string

Verify() public static method

public static Verify ( string hashedPassword, string password ) : bool
hashedPassword string
password string
return bool