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");

Libraries

flutter_aes

Dart

VM

dart:ffi
Foreign Function Interface for interoperability with the C programming language. [...]

Web

dart:html
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
dart:js
Low-level support for interoperating with JavaScript. [...]
dart:js_util
Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.