C# Class Contrive.Common.CryptographerBase

Inheritance: ICryptographer
Show file Open project: alanstevens/Contrive

Public Methods

Method Description
CalculatePasswordHash ( string password, string salt ) : string
Decrypt ( string encryptedData ) : string
DecryptHashed ( string encryptedData ) : string
Encrypt ( string dataToEncrypt ) : string
EncryptAndHash ( string dataToEncrypt ) : string
GenerateDecryptionKey ( ) : string
GenerateSalt ( ) : string
GenerateToken ( ) : string
GenerateValidationKey ( ) : string
Hash ( string dataToHash ) : string
ValidateHash ( string hashedData ) : string

Protected Methods

Method Description
Protect ( string input, Protection protectionOption ) : string
Unprotect ( string encodedData, Protection protectionOption ) : string

Private Methods

Method Description
GetRandomBuffer ( int bufferSize ) : byte[]

Method Details

CalculatePasswordHash() public method

public CalculatePasswordHash ( string password, string salt ) : string
password string
salt string
return string

Decrypt() public method

public Decrypt ( string encryptedData ) : string
encryptedData string
return string

DecryptHashed() public method

public DecryptHashed ( string encryptedData ) : string
encryptedData string
return string

Encrypt() public method

public Encrypt ( string dataToEncrypt ) : string
dataToEncrypt string
return string

EncryptAndHash() public method

public EncryptAndHash ( string dataToEncrypt ) : string
dataToEncrypt string
return string

GenerateDecryptionKey() public method

public GenerateDecryptionKey ( ) : string
return string

GenerateSalt() public method

public GenerateSalt ( ) : string
return string

GenerateToken() public method

public GenerateToken ( ) : string
return string

GenerateValidationKey() public method

public GenerateValidationKey ( ) : string
return string

Hash() public method

public Hash ( string dataToHash ) : string
dataToHash string
return string

Protect() protected abstract method

protected abstract Protect ( string input, Protection protectionOption ) : string
input string
protectionOption Protection
return string

Unprotect() protected abstract method

protected abstract Unprotect ( string encodedData, Protection protectionOption ) : string
encodedData string
protectionOption Protection
return string

ValidateHash() public method

public ValidateHash ( string hashedData ) : string
hashedData string
return string