jodd-core/src/main/java/jodd/crypt/PBKDF2Hash.java
private static byte[] pbkdf2(final char[] password, final byte[] salt, final int iterations, final int bytes) {
		PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, bytes * 8);
		try {
			SecretKeyFactory skf = SecretKeyFactory.getInstance(PBKDF2_ALGORITHM);
			return skf.generateSecret(spec).getEncoded();
		}
		catch (NoSuchAlgorithmException ignore) {
			return null;
		}
		catch (InvalidKeySpecException e) {
			throw new IllegalArgumentException(e);
		}
	}
private static byte[] pbkdf2(final char[] password, final byte[] salt, final int iterations, final int bytes) {
		PBEKeySpec spec = new PBEKeySpec(password, salt, iterations, bytes * 8);
		try {
			SecretKeyFactory skf = SecretKeyFactory.getInstance(PBKDF2_ALGORITHM);
			return skf.generateSecret(spec).getEncoded();
		}
		catch (NoSuchAlgorithmException ignore) {
			return null;
		}
		catch (InvalidKeySpecException e) {
			throw new IllegalArgumentException(e);
		}
	}
private static byte [ ] pbkdf2 ( final char [ ] password , final byte [ ] salt , final int iterations , final int bytes ) { PBEKeySpec spec = new PBEKeySpec ( password , salt , iterations , bytes * 8 ) ; try { SecretKeyFactory skf = SecretKeyFactory . getInstance ( PBKDF2_ALGORITHM ) ; return skf . generateSecret ( spec ) . getEncoded ( ) ; } catch ( NoSuchAlgorithmException ignore ) { return null ; } catch ( InvalidKeySpecException e ) { throw new IllegalArgumentException ( e ) ; } }
Computes the PBKDF2 hash of a password.

@param password the password to hash.
@param salt the salt
@param iterations the iteration count (slowness factor)
@param bytes the length of the hash to compute in bytes
@return the PBDKF2 hash of the password
Computes the PBKDF2 hash of a password .