encryptions

A plugin for using native AES /Argon2 algorithms in Android/IOS.

Test report

Getting Started

Supported algorithms:

  • AES(128bit or 256bit) in ECB or CBC mode, with NoPadding or PKCS5Padding
  • argon2i, argon2d, argon2id

AES example usage

Uint8List key256 = hex
    .decode("163928fb9615edf6005afc98d9fdbb3d830b3a286ebef64dd70be848f17bf9cc");
Uint8List iv = hex.decode("c1f6fd873e14050697c168b3e9da5db2");
Uint8List plain = hex.decode("01040000000300000002400000008b2e");

AES aes = AES.ofCBC(key256, iv, PaddingScheme.PKCS5Padding);
    Uint8List encrypted = await aes.encrypt(plain);
    Uint8List decrypted = await aes.decrypt(encrypted);

Argon2 example usage

Uint8List password = utf8.encode("password");
Uint8List salt = utf8.encode("helloworld");

Argon2 argon2 = Argon2(iterations: 16, hashLength: 64, memory: 256, parallelism: 2);
    Uint8List hash = await argon2.argon2i(password, salt);

for more details, try to have a look at example/lib/platform_test.dart

Libraries

encryptions

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.