如何在Flutter/Dart中进行Blowfish CBC解密?我找不到任何支持它的库。
dbcrypt仅支持密码哈希,不支持cbc模式。
谢谢。
发布于 2020-03-13 14:48:15
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:encrypt/encrypt.dart';
class _MyHomePageState extends State<MyHomePage> {
final plainText = 'some plain text here';
final key = encrypt.Key.fromUtf8('16 characters key');
final iv = IV.fromLength(16);
final encrypter = Encrypter(AES(key,mode: AESMode.cbc,padding: 'PKCS7'));
final encrypted = encrypter.encrypt(plainText, iv: iv);
final decrypted = encrypter.decrypt(encrypted, iv: iv);
print(decrypted);
print(encrypted.base64);pubspec.yaml:
dependencies:
encrypt: ^4.0.0https://stackoverflow.com/questions/55664280
复制相似问题