decrypt static method

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

AES/CBC/ZeroByte Decrypt

Implementation

static Uint8List decrypt(Uint8List encrypted, {Uint8List? key, Uint8List? iv}) {
  registry.register(ZeroBytePadding.FACTORY_CONFIG);
  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/ZeroByte");
  decryptionCipher.init(false, params);
  return decryptionCipher.process(encrypted);
}