quick_native_crypto 0.2.0 copy "quick_native_crypto: ^0.2.0" to clipboard
quick_native_crypto: ^0.2.0 copied to clipboard

A Flutter plugin for native crypto APIs.

quick_native_crypto #

pub package

A Flutter plugin for native crypto APIs.

iOS Android macOS

Usage #

///
/// Encrypts [plaintext] using AES-GCM based on [key] and [nonce].
///
/// Valid key lengths are 128, 192, or 256 bits.
/// Returns a [SealedBox] containing a [ciphertext] and a [mac].
Future<SealedBox> aesEncrypt(
    {required Uint8List plaintext,
    required Uint8List key,
    required Uint8List nonce});

///
/// Decrypts [ciphertext] with AES-GCM based on [key], [nonce] and [mac].
///
/// Valid key lengths are 128, 192, or 256 bits.
/// Returns a [Uint8List] as decrypted data.
Future<Uint8List> aesDecrypt(
    {required Uint8List ciphertext,
    required Uint8List key,
    required Uint8List nonce,
    required Uint8List mac});
final plugin = QuickNativeCrypto();

var sealedBox = await plugin.aesEncrypt(...);
var plaintext = await plugin.aesDecrypt(...);
0
likes
150
points
28
downloads

Publisher

verified publisherflutter-cavalry.com

Weekly Downloads

A Flutter plugin for native crypto APIs.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on quick_native_crypto