C# 클래스 Recognos.Core.SaltedHash

Implementation for hashing a salted password and verifying the hash.
파일 보기 프로젝트 열기: Recognos/Recognos.Core 1 사용 예제들

공개 메소드들

메소드 설명
Generate ( string password ) : string

Generates the hash.

SaltedHash ( ) : System.Linq

Initializes a new instance of the SaltedHash class.

Default constructor which initializes the SaltedHash with the SHA256Managed algorithm and a Salt of 4 bytes ( or 4*8 = 32 bits)

SaltedHash ( HashAlgorithm hashAlgorithm, int saltLength ) : System.Linq

Initializes a new instance of the SaltedHash class.

Verify ( string password, string hash ) : bool

Verifies the hash.

VerifyHash ( string password, string hash ) : bool

Verifies the hash.

비공개 메소드들

메소드 설명
ComputeHash ( byte password, byte salt ) : byte[]

The actual hash calculation is shared by both GetHashAndSalt and the VerifyHash functions

GenerateHash ( string password ) : string
GenerateSalt ( ) : byte[]

Generates the salt.

메소드 상세

Generate() 공개 정적인 메소드

Generates the hash.
public static Generate ( string password ) : string
password string The password.
리턴 string

SaltedHash() 공개 메소드

Initializes a new instance of the SaltedHash class.
Default constructor which initializes the SaltedHash with the SHA256Managed algorithm and a Salt of 4 bytes ( or 4*8 = 32 bits)
public SaltedHash ( ) : System.Linq
리턴 System.Linq

SaltedHash() 공개 메소드

Initializes a new instance of the SaltedHash class.
public SaltedHash ( HashAlgorithm hashAlgorithm, int saltLength ) : System.Linq
hashAlgorithm System.Security.Cryptography.HashAlgorithm A HashAlgorihm which is derived from HashAlgorithm. C# provides /// the following classes: SHA1Managed,SHA256Managed, SHA384Managed, SHA512Managed and MD5CryptoServiceProvider
saltLength int Length of the salt.
리턴 System.Linq

Verify() 공개 정적인 메소드

Verifies the hash.
public static Verify ( string password, string hash ) : bool
password string The password.
hash string The hash.
리턴 bool

VerifyHash() 공개 메소드

Verifies the hash.
public VerifyHash ( string password, string hash ) : bool
password string The password.
hash string The hash.
리턴 bool