AES Pack

aespack use AES-CBC-PKCS5Padding. This library originally from react-native-aes-kit, i just porting each platform native code to work with Flutter.

Methods

encrypt

NameDescription
textplain text
keysecret key, max 16 bytes
ivinitialization vector, max 16 bytes

decrypt

NameDescription
textcipher text
keysecret key, max 16 bytes
ivinitialization vector, max 16 bytes

How To Use

encrypt

import 'package:aespack/aespack.dart';
...
// inside async method
var text = 'Test';
var key = '0102030405060708';
var iv = '1112131415161718';
var result = await Aespack.encrypt(text, key, iv);
// result is 'IOCQgs4aK+K4lVWSg/W81w=='

decrypt

import 'package:aespack/aespack.dart';
...
// inside async method
var text = 'IOCQgs4aK+K4lVWSg/W81w==';
var key = '0102030405060708';
var iv = '1112131415161718';
var result = await Aespack.decrypt(text, key, iv);
// result is 'Test'

Libraries

aespack