new PaddedBufferedBlockCipher(new CBCBlockCipher(
new AESEngine()))));
cipher.engineInit(forEncryption ? Cipher.ENCRYPT_MODE
: Cipher.DECRYPT_MODE, recipient, new SecureRandom());
return cipher.engineDoFinal(input, 0, input.length);
}
public static byte[] generateAESKey() {
byte[] result = new byte[32];
new SecureRandom().nextBytes(result);