char[] to byte[] conversion without specifying an encoding cause errors when using non-ascii symbols in passwords.
@@ -60,7 +60,7 @@ protected SecretKey engineGenerateSecret(
OpenSSLPBEParametersGenerator pGen = new OpenSSLPBEParametersGenerator();
- pGen.init(Strings.toByteArray(pbeSpec.getPassword()), pbeSpec.getSalt());
+ pGen.init(Strings.toUTF8ByteArray(pbeSpec.getPassword()), pbeSpec.getSalt());
return new SecretKeySpec(((KeyParameter)pGen.generateDerivedParameters(pbeSpec.getKeyLength())).getKey(), "OpenSSLPBKDF");
}
