private byte[] generateSalt(int saltSize) throws NoSuchAlgorithmException, NoSuchProviderException {
SecureRandom sr = new SecureRandom();
// Note that the nexus code seeds the SecureRandom:
// this seems to be both unnecessary and incorrect
return sr.generateSeed(saltSize);
}
private Cipher buildCipher(String passphrase, byte[] salt, int mode) throws InvalidKeySpecException,
NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException {
KeySpec keySpec = new PBEKeySpec(passphrase.toCharArray());