C# Class BgEngine.Infraestructure.Security.CodeFirstCrypto

Datei anzeigen Open project: yagopv/BgEngine Class Usage Examples

Public Methods

Method Description
GenerateSalt ( int byteLength = SALT_SIZE ) : string
Hash ( byte input, string algorithm = "sha256" ) : string
Hash ( string input, string algorithm = "sha256" ) : string
HashPassword ( string password ) : string
SHA1 ( string input ) : string
SHA256 ( string input ) : string
VerifyHashedPassword ( string hashedPassword, string password ) : bool

Private Methods

Method Description
BinaryToHex ( byte data ) : string
ByteArraysEqual ( byte a, byte b ) : bool
GenerateSaltInternal ( int byteLength = SALT_SIZE ) : byte[]
GenerateToken ( ) : string

Method Details

GenerateSalt() public static method

public static GenerateSalt ( int byteLength = SALT_SIZE ) : string
byteLength int
return string

Hash() public static method

public static Hash ( byte input, string algorithm = "sha256" ) : string
input byte
algorithm string
return string

Hash() public static method

public static Hash ( string input, string algorithm = "sha256" ) : string
input string
algorithm string
return string

HashPassword() public static method

public static HashPassword ( string password ) : string
password string
return string

SHA1() public static method

public static SHA1 ( string input ) : string
input string
return string

SHA256() public static method

public static SHA256 ( string input ) : string
input string
return string

VerifyHashedPassword() public static method

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