public class AESCipher {
private PaddedBufferedBlockCipher bp;
/** Creates a new instance of AESCipher */
public AESCipher(boolean forEncryption, byte[] key, byte[] iv) {
BlockCipher aes = new AESFastEngine();
BlockCipher cbc = new CBCBlockCipher(aes);
bp = new PaddedBufferedBlockCipher(cbc);
KeyParameter kp = new KeyParameter(key);
ParametersWithIV piv = new ParametersWithIV(kp, iv);
bp.init(forEncryption, piv);