Вам не нужно PaddedBlockCipherParameters
, поскольку вы не используете мягкий шифр.
Попробуйте:
import 'dart:typed_data';
import 'package:pointycastle/api.dart';
import 'package:pointycastle/block/aes_fast.dart';
import 'package:pointycastle/block/modes/ecb.dart';
main() {
Uint8List key = Uint8List.fromList(
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
);
Uint8List plainText = Uint8List.fromList(
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
);
BlockCipher cipher = ECBBlockCipher(AESFastEngine());
cipher.init(
true,
KeyParameter(key),
);
Uint8List cipherText = cipher.process(plainText);
}