Skip to content

原生系统的aes 加密 解密,纯dart的方式处理大数据时有点慢

License

Notifications You must be signed in to change notification settings

jlcool/flutter_aes

Repository files navigation

Pub

flutter_aes

一个原生实现的aes加密解密方法,本来原生可以实现,但是数据量大的时候就卡住了

dart的base64和utf8方法不比原生的慢,所以只有加密解密并返回Uint8List

Example

import 'package:flutter_aes/flutter_aes.dart';

String _key = "f379e0b661ae4650b19169e4d93665dc";
String _iv = "0000000000000000";
Stopwatch stopwatch = Stopwatch()..start();

var result = base64.encode(await FlutterAes.encrypt(utf8.encode("123"), utf8.encode(_key), utf8.encode(_iv)));
print("encrypt 用时:${stopwatch.elapsed} result:$result");
result = utf8.decode(await FlutterAes.decrypt(
base64.decode(result), utf8.encode(_key), utf8.encode(_iv)));
print("decrypt 用时:${stopwatch.elapsed} result:$result");

About

原生系统的aes 加密 解密,纯dart的方式处理大数据时有点慢

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published