charPassword[i] = (char) (password[i] + 256); // cope with signed -> unsigned
}
}
try {
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
KeySpec spec = new PBEKeySpec(charPassword, salt, rounds, 8 * outputByteCount);
return factory.generateSecret(spec).getEncoded();
} catch (NoSuchAlgorithmException e) {
throw new NigoriCryptographyException(e);
} catch (InvalidKeySpecException e) {
throw new NigoriCryptographyException(e);