dart_sodium 2.0.0 copy "dart_sodium: ^2.0.0" to clipboard
dart_sodium: ^2.0.0 copied to clipboard

discontinued

Wrapper library for the libsodium cryptography library. Contains functions for password hashing, random numbers, encryption, message authentication etc.

example/example.dart

import 'dart:convert';

import 'package:dart_sodium/secret_box.dart' as secret_box;
import 'package:dart_sodium/random_bytes.dart' as random_bytes;
import 'package:dart_sodium/sodium.dart' as sodium;

void main(List<String> args) {
  sodium.init();
  final key = secret_box.keyGen();
  final msg = utf8.encode('hello world');

  final nonce = random_bytes.buffer(secret_box.nonceBytes);
  final c = secret_box.easy(msg, nonce, key);

  final decrypted = secret_box.openEasy(c, nonce, key);
}
2
likes
35
points
13
downloads

Publisher

unverified uploader

Weekly Downloads

Wrapper library for the libsodium cryptography library. Contains functions for password hashing, random numbers, encryption, message authentication etc.

Repository (GitLab)

License

MIT (license)

Dependencies

ffi, ffi_helper, meta

More

Packages that depend on dart_sodium