encryptBytesWithAes static method

Uint8List encryptBytesWithAes(
  1. Uint8List data,
  2. Uint8List key
)

Encrypts the given data with AES using the specified key.

Implementation

static Uint8List encryptBytesWithAes(Uint8List data, Uint8List key) {
  final ecbChiper = PaddedBlockCipher('AES/ECB/PKCS7');
  final params = PaddedBlockCipherParameters(KeyParameter(key), null);
  ecbChiper.init(true, params);

  return ecbChiper.process(data);
}