PasswordHasher

The PasswordHashers convert a value from a UI component to a specific hash value depending on the converter. This functionality can be used with a PasswordField, for example, to write a password to the database as a hash value.

The following converters are available.

To be found in the interface "com.rapidclipse.framework.security.util.PasswordHasher ":

  1. MD5

  2. SHA1

  3. SHA2

  4. PBKDF2WithHmacSHA1

Application:

Hashen PasswordField value with SHA2:

byte[] passwordBytes = passwordField.getValue().getBytes();
byte[] hashedPasswordBytes = PasswordHasher.Sha2().hashPassword(passwordBytes);