decrypt static method

Uint8List decrypt(
  1. Uint8List encrypted, {
  2. Uint8List? key,
  3. Uint8List? iv,
})

AES/CBC/PKCS7 Decrypt

Implementation

static Uint8List decrypt(Uint8List encrypted, {Uint8List? key, Uint8List? iv}) {
  if (key == null) {
    key = Uint8List(1);
  }
  if (iv == null) {
    iv = Uint8List(1);
  }
  CipherParameters params = PaddedBlockCipherParameters(
      ParametersWithIV(KeyParameter(key), iv), null);
  BlockCipher decryptionCipher = PaddedBlockCipher("AES/CBC/PKCS7");
  decryptionCipher.init(false, params);
  return decryptionCipher.process(encrypted);
}