Package com.peterphi.usermanager.db
Class BCrypt
java.lang.Object
com.peterphi.usermanager.db.BCrypt
A wrapper for BCrypt
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
DEFAULT_COST
public static final int DEFAULT_COST- See Also:
-
-
Constructor Details
-
BCrypt
public BCrypt()
-
-
Method Details
-
hash
- Parameters:
password
- the plaintext passwordcost
- the computation cost (complexity increases at2**cost
)- Returns:
-
verify
Check that a plaintext password matches a previously hashed one- Parameters:
password
- the plaintext password to verifyhash
- the previously-hashed password (a 60-character BCrypt hash string)- Returns:
- true if the passwords match, false otherwise
-