rusty_chacha_dart 0.6.1+1 copy "rusty_chacha_dart: ^0.6.1+1" to clipboard
rusty_chacha_dart: ^0.6.1+1 copied to clipboard

A Flutter library for fast ChaCha20-Poly1305 encryption, powered by Rust

example/lib/main.dart

import 'dart:typed_data';

import 'package:collection/collection.dart';
import 'package:rusty_chacha_dart/rusty_chacha_dart.dart';

void main() async {
  final data = Uint8List.fromList([1, 2, 3, 4, 5]);
  print('data: $data');

  // Create and use a ChaCha20Poly1305 cipher with a random key:
  RustyChaCha20Poly1305 cipher = await RustyChaCha.create();

  Uint8List encrypted = await cipher.encrypt(cleartext: data);
  print('encrypted: $encrypted');

  Uint8List decrypted = await cipher.decrypt(ciphertext: encrypted);
  print('decrypted: $decrypted');

  assert(const ListEquality().equals(data, decrypted));
}
0
likes
0
pub points
31%
popularity

Publisher

verified publisher32k.eu

A Flutter library for fast ChaCha20-Poly1305 encryption, powered by Rust

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, flutter_rust_bridge, freezed_annotation

More

Packages that depend on rusty_chacha_dart