SecureHash
This is the legacy API.
- Value parameters:
- cryptoAlgo
HMAC+SHA512 is the default as HMAC+SHA1 is now considered weak
- dkLength
derived-key length, default to 32
- iterations
the number of encryption iterations. Default to 210000
Value members
Concrete methods
Validate a password against a password hash
Validate a password against a password hash
this function will first try to validate with the new format as generated by io.github.nremond.SecureHash.createHash. if it fails, it will fall back to the old format, making this function very useful when transitioning form the old to the new format.
- Value parameters:
- hashedPassword
the password hash.
- password
the password to validate
- Returns:
true is the password is valid
Deprecated methods
Creates a hashed password using PBKDF2
Creates a hashed password using PBKDF2
this function output a string in the following format:
salt:key
-
salt : hex encoded salt
-
key : hex encoded derived key
Example :
a9c654289407047fd197516196e14b97bdabfa4bc934d0e9:f2f458b2502ca7595a4c964b14f146bd9c49174fa41b625227602bf4aaffbf5e
- Value parameters:
- password
the password to hash
- Deprecated