lazychacha 1.0.1 copy "lazychacha: ^1.0.1" to clipboard
lazychacha: ^1.0.1 copied to clipboard

Lazy ChaCha20-Poly1305 in Flutter base on cryptography

lazychacha #

Lazy ChaCha20-Poly1305 in Flutter base on cryptography

"Buy Me A Coffee"

Algorithm details #

  • Key exchange: X25519
  • Encryption: ChaCha20
  • Authentication: Poly1305

Usage #

  • pubspec.yml
dependencies:
  lazychacha: ^1.0.0
  • Dart
final lazychacha = LazyChaCha.instance;

How to use #

  • Generate KeyPair
final keyPair = await KeyPair.newKeyPair();
  • Key Exchange & Shared Key
final clientKeyPair = await KeyPair.newKeyPair();
final serverKeyPair = await KeyPair.newKeyPair();

final clientSharedKey = await clientKeyPair.sharedKey(serverKeyPair.pk);
  • Encrypt
final lazyChaCha = LazyChaCha.instance;
final sharedKey = await clientKeyPair.sharedKey(serverKeyPair.pk);
const plaintext = '{"message": "Hi"}';

final ciphertext = await lazyChaCha.encrypt(plaintext, sharedKey);
  • Decrypt
final lazyChaCha = LazyChaCha.instance;
final sharedKey = await clientKeyPair.sharedKey(serverKeyPair.pk);
const ciphertext = '1ec54672d8ef2cca351';

final plaintext = await lazyChaCha.decrypt(ciphertext, sharedKey);
1
likes
120
pub points
0%
popularity

Publisher

verified publisherwachasit.com

Lazy ChaCha20-Poly1305 in Flutter base on cryptography

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

convert, cryptography, flutter

More

Packages that depend on lazychacha