프로퍼티 | 타입 | 설명 | |
---|---|---|---|
Decrypt | string | ||
Encrypt | |||
Factory | Func |
||
Factory | Func |
||
GenerateSalt | byte[] | ||
HMAC | |||
Hash | |||
HashWithAuthentication | |||
SHA | |||
SlowEquals | bool |
메소드 | 설명 | |
---|---|---|
Decrypt ( |
|
|
Decrypt ( string secureString ) : string |
Ontsleutel een versleutelde string welke is versleuteld met de Encrypt methode.
|
|
Encrypt ( string text, string key ) : |
Versleutel een willekeurige string naar een onleesbare variant welke moeilijk is om te kraken. Deze methode dient alleen gebruikt te worden indien de versleutelde tekst ook weer ontsleuteld moet kunnen woren (anders moet je een hash gebruiken).
|
|
Encrypt ( string text ) : string |
Versleutel een willekeurige string naar een onleesbare variant welke moeilijk is om te kraken. Deze methode dient alleen gebruikt te worden indien de versleutelde tekst ook weer ontsleuteld moet kunnen woren (anders moet je een hash gebruiken).
|
|
GeneratePassword ( int length = 12, int minLowerCharCount = 1, int minUpperCharCount = 1, int minDigitCount = 1, int minSpecialCharCount = 1 ) : string |
Generate a random password. The "flavour" of the generated password can be altered by changing the password length and minimum character count per type in the method's parameters. Keep in mind that the 'length' parameter may not be smaller then the sum of all the minimum character counts from the other parameters. If the length value exceeds the sum of all the minimum character counts, the miscelanious characters will have be of a random type. If the minimum character count of a type is set to 0, the generated password will not contain any characters of this type.
|
|
Hash ( string text, string salt, EnmHashingAlgorithm algorithm = EnmHashingAlgorithm.SHA512 ) : |
Transform any arbitrary input string into a secure and unintelligible hash (string). - Simple and quick - Low level security - NOT to be used for sensitive data such as passwords. Instead use the method method HashPassword. Not to be used for sensitive data such as passwords |
|
Hash ( string text ) : string |
Generate a simple (SHA512) hash from an arbitrary string. NOTE: This method generates a random salt every time the method is called. Calling the method twice will result in two different hash strings. If the Hash is to be used for simple verification purposes, please call the overloaded Hash method.
|
|
HashPassword ( string password, EnmSecureHashingAlgorithm algorithm, string salt, string key ) : |
|
|
HashPassword ( string password ) : string |
Genereer een veilige(re) hash voor een string die belangrijke data bevat, zoals een wachtwoord. Deze methode is CPU intensiever dan de methode 'HashString', welke op zijn beurt beter gebruikt kan worden voor snelle en simpele authenticatie hashes.
|
|
HashWithAuthentication ( string text, string salt, EnmHashingAlgorithm algorithm, string key ) : |
Transform any arbitrary input string into a secure and unintelligible hash (string). This method is a keyed hashing method which is a lot more secure then the regular hashing methods - The generated keyed hash can be used to verify the authenticity of a message - NOT to be used for securing passwords, instead use the provided method HashPassword. Not to be used for sensitive data such as passwords |
|
HashWithAuthentication ( string text ) : string |
Generates a more secure hash, using a secret key generated from the secret masterkey (specified in the web.config).
|
|
ValidateAuthenticationHash ( string verificationText, string hashedText, string key ) : bool |
Determines if the contents of the hash string 'hashedText' matches the raw input string 'verificationText'.
|
|
ValidateHash ( string originalText, string hashedText ) : bool |
Determines if the contents of the hash string 'hashedText' matches the raw input string 'verificationText'.
|
|
ValidatePasswordHash ( string password, EnmSecureHashingAlgorithm method, string salt, int iteraties, string passwordHash ) : bool |
Valideer of een wachtwoord geldig is door deze met de ingevoerde parameters te vergelijken.
|
|
ValidatePasswordHash ( string password, string passwordHash ) : bool |
Valideer of een wachtwoord geldig is door deze met de beveiligde hash te vergelijken.
|
메소드 | 설명 | |
---|---|---|
Decrypt ( byte cipherText, byte salt, byte key ) : string | ||
Encrypt ( byte text, byte key ) : |
||
Factory ( this enm ) : Func |
||
Factory ( this enm ) : Func |
||
GenerateSalt ( ) : byte[] | ||
HMAC ( this enm ) : |
||
Hash ( byte text, byte salt, |
||
HashWithAuthentication ( byte text, byte salt, byte key, EnmHashingAlgorithm algorithm ) : |
||
SHA ( this enm ) : |
||
SlowEquals ( byte a, byte b ) : bool |
public static Decrypt ( |
||
data | ||
key | string | |
리턴 | string |
public static Decrypt ( string secureString ) : string | ||
secureString | string | De volledige secure string zoals deze gegenereerd wordt door Encrypt() |
리턴 | string |
public static Encrypt ( string text, string key ) : |
||
text | string | De tekst welke versleuteld dient te worden |
key | string | De geheime sleutel waarmee de tekst versleuteld dient te worden |
리턴 |
public static Encrypt ( string text ) : string | ||
text | string | De tekst welke versleuteld dient te worden |
리턴 | string |
public static GeneratePassword ( int length = 12, int minLowerCharCount = 1, int minUpperCharCount = 1, int minDigitCount = 1, int minSpecialCharCount = 1 ) : string | ||
length | int | The exact length of the password that is to be generated |
minLowerCharCount | int | The minimum number of lowercase characters that should be present in the output |
minUpperCharCount | int | The minimum number of uppsercase characters that should be present in the output |
minDigitCount | int | The minimum number of digits that should be present in the output |
minSpecialCharCount | int | The minimum number of special characters that should be present in the output |
리턴 | string |
public static Hash ( string text, string salt, EnmHashingAlgorithm algorithm = EnmHashingAlgorithm.SHA512 ) : |
||
text | string | The input string to hash |
salt | string | A string containing 16 or more random characters. The salt should be saved together with the hash. Only use each salt once (read: generate a new salt every time you hash) |
algorithm | EnmHashingAlgorithm | The algorithm that should perform the hashing operation |
리턴 |
public static Hash ( string text ) : string | ||
text | string | The text to generate the hash for |
리턴 | string |
public static HashPassword ( string password, EnmSecureHashingAlgorithm algorithm, string salt, string key ) : |
||
password | string | |
algorithm | EnmSecureHashingAlgorithm | |
salt | string | De te gebruiken salt, welke minimaal uit 16 karakters dient te bestaan |
key | string | De primaire (master) sleutel waarmee de hash gegenereerd dient te worden |
리턴 |
public static HashPassword ( string password ) : string | ||
password | string | De veilige string welke gehashed moet worden |
리턴 | string |
public static HashWithAuthentication ( string text, string salt, EnmHashingAlgorithm algorithm, string key ) : |
||
text | string | The input string to hash |
salt | string | A string containing 16 or more random characters. The salt should be saved together with the hash. Only use each salt once (read: generate a new salt every time you hash) |
algorithm | EnmHashingAlgorithm | The hashing algorithm to use for the hashing proces |
key | string | The secret key to be used to generate the hash. T |
리턴 |
public static HashWithAuthentication ( string text ) : string | ||
text | string | The input string to hash |
리턴 | string |
public static ValidateAuthenticationHash ( string verificationText, string hashedText, string key ) : bool | ||
verificationText | string | The raw text to validate |
hashedText | string | The hashed string to validate against |
key | string | The secret key used to generate the hash |
리턴 | bool |
public static ValidateHash ( string originalText, string hashedText ) : bool | ||
originalText | string | The original text to validate against the hash |
hashedText | string | The complete secure hash string as produced by the other hashing methods |
리턴 | bool |
public static ValidatePasswordHash ( string password, EnmSecureHashingAlgorithm method, string salt, int iteraties, string passwordHash ) : bool | ||
password | string | Het plain text wachtwoodr dat vergeleken moet worden met de secure hash |
method | EnmSecureHashingAlgorithm | Het te gebruiken hashing algorithme |
salt | string | Base-64 Encoded salt (gegenereerd met de methode HashPassword) |
iteraties | int | Het aantal hashing iteraties |
passwordHash | string | Base-64 Encoded password hash(Zoals gegenereerd uit de methode HashPassword) |
리턴 | bool |
public static ValidatePasswordHash ( string password, string passwordHash ) : bool | ||
password | string | Het te valideren wachtwoord |
passwordHash | string | De secure string (gegenereerd met de methode HashPassword) |
리턴 | bool |