encrypt static method
AES/CBC/ZeroByte Encrypt
Implementation
static Uint8List encrypt(Uint8List value, {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 encryptionCipher = PaddedBlockCipher("AES/CBC/ZeroByte");
encryptionCipher.init(true, params);
return encryptionCipher.process(value);
}