![]() |
Sphyrnidae Common Library
2.0.1
Shared Utilities/Library
|
Encrypts or decrypts a string. More...
Public Member Functions | |
EncryptionDispatcher (IEncryptionAlgorithms algorithms) | |
byte[] | Hash (string str, string salt) |
Performs hashing (1-way encryption) against the string using the given salt More... | |
bool | HashMatch (string str, string salt, byte[] hash) |
Determines if the hashed string is the same as what was provided (eg. passwords match) More... | |
string | Encrypt (string str) |
Encrypts the given string More... | |
DecryptionResponse | Decrypt (string str) |
Decrypts the given string More... | |
Protected Member Functions | |
EncryptionAlgorithm | FindAlgorithm (string str) |
Static Protected Member Functions | |
static string | AddIdentifier (EncryptionAlgorithm algorithm, string str) |
static string | RemoveIdentifier (EncryptionAlgorithm algorithm, string str) |
Properties | |
IEncryptionAlgorithms | Algorithms [get] |
EncryptionAlgorithm | CurrentAlgorithm [get] |
Encrypts or decrypts a string.
Note that this class doesn't actually perform encryption activities. It instead passes it off to the correct handler to do the encryption/decryption.
Sphyrnidae.Common.Encryption.EncryptionDispatcher.EncryptionDispatcher | ( | IEncryptionAlgorithms | algorithms | ) |
|
staticprotected |
DecryptionResponse Sphyrnidae.Common.Encryption.EncryptionDispatcher.Decrypt | ( | string | str | ) |
Decrypts the given string
str | The string to decrypt |
Note that decryption failures may throw an exception, or just return null value
Implements Sphyrnidae.Common.Encryption.IEncryption.
string Sphyrnidae.Common.Encryption.EncryptionDispatcher.Encrypt | ( | string | str | ) |
Encrypts the given string
str | The string to encrypt |
Note that encryption failures may throw an exception, or just return null
Implements Sphyrnidae.Common.Encryption.IEncryption.
|
protected |
byte [] Sphyrnidae.Common.Encryption.EncryptionDispatcher.Hash | ( | string | str, |
string | salt | ||
) |
Performs hashing (1-way encryption) against the string using the given salt
str | The string to 1-way encrypt |
salt | A non-private/secure string used in the encryption process |
Implements Sphyrnidae.Common.Encryption.IEncryption.
bool Sphyrnidae.Common.Encryption.EncryptionDispatcher.HashMatch | ( | string | str, |
string | salt, | ||
byte[] | hash | ||
) |
Determines if the hashed string is the same as what was provided (eg. passwords match)
str | The string to hash |
salt | The hashing salt |
hash | The hash to compare |
Implements Sphyrnidae.Common.Encryption.IEncryption.
|
staticprotected |
|
getprotected |
|
getprotected |