PBKDF2-HMAC-SHA256 password hasher ported from Kiwi and HouseDB. More...
Public Member Functions | |
| PasswordHash | hash (final char[] password, final byte[] salt, final int iterations) |
| Hashes a password using PBKDF2-HMAC-SHA256. | |
| PasswordHasherPBKDF2 (final int derivedKeyBytes) | |
| Creates a new PBKDF2 password hasher. | |
| boolean | verify (final char[] password, final byte[] salt, final int iterations, final byte[] expectedHash) |
| Verifies a password against an expected hash using PBKDF2-HMAC-SHA256. | |
PBKDF2-HMAC-SHA256 password hasher ported from Kiwi and HouseDB.
Definition at line 37 of file PasswordHasherPBKDF2.java.
| dev.rafex.ether.crypto.password.PasswordHasherPBKDF2.PasswordHasherPBKDF2 | ( | final int | derivedKeyBytes | ) |
Creates a new PBKDF2 password hasher.
| derivedKeyBytes | The number of bytes for the derived key (minimum 16). |
| IllegalArgumentException | if derivedKeyBytes is less than 16. |
Definition at line 49 of file PasswordHasherPBKDF2.java.
| PasswordHash dev.rafex.ether.crypto.password.PasswordHasherPBKDF2.hash | ( | final char[] | password, |
| final byte[] | salt, | ||
| final int | iterations ) |
Hashes a password using PBKDF2-HMAC-SHA256.
| password | The password to hash. |
| salt | The random salt bytes. |
| iterations | The number of PBKDF2 iterations. |
PasswordHash. | IllegalArgumentException | if password is null, salt is null or empty, or iterations is not positive. |
Implements dev.rafex.ether.crypto.password.PasswordHasher.
Definition at line 89 of file PasswordHasherPBKDF2.java.
References dev.rafex.ether.crypto.password.PasswordHash().
| boolean dev.rafex.ether.crypto.password.PasswordHasherPBKDF2.verify | ( | final char[] | password, |
| final byte[] | salt, | ||
| final int | iterations, | ||
| final byte[] | expectedHash ) |
Verifies a password against an expected hash using PBKDF2-HMAC-SHA256.
| password | The password to verify. |
| salt | The random salt bytes. |
| iterations | The number of PBKDF2 iterations. |
| expectedHash | The expected hash bytes. |
true if the password matches the expected hash, false otherwise. Implements dev.rafex.ether.crypto.password.PasswordHasher.
Definition at line 66 of file PasswordHasherPBKDF2.java.