cryptography_plus 2.7.1 copy "cryptography_plus: ^2.7.1" to clipboard
cryptography_plus: ^2.7.1 copied to clipboard

Cryptographic algorithms for encryption, digital signatures, key agreement, authentication, and hashing. AES, Chacha20, ED25519, X25519, Argon2, and more. Good cross-platform support.

example/lib/example.dart

import 'package:cryptography_plus/cryptography_plus.dart';

Future<void> main() async {
  final algorithm = AesGcm.with256bits();

  // Generate a random 256-bit secret key
  final secretKey = await algorithm.newSecretKey();

  // Generate a random 96-bit nonce.
  final nonce = algorithm.newNonce();

  // Encrypt
  final clearText = [1, 2, 3];
  final secretBox = await algorithm.encrypt(
    clearText,
    secretKey: secretKey,
    nonce: nonce,
  );
  print('Ciphertext: ${secretBox.cipherText}');
  print('MAC: ${secretBox.mac}');
}
4
likes
150
points
723
downloads

Publisher

verified publisheremz-hanauer.com

Weekly Downloads

Cryptographic algorithms for encryption, digital signatures, key agreement, authentication, and hashing. AES, Chacha20, ED25519, X25519, Argon2, and more. Good cross-platform support.

Repository (GitHub)
View/report issues

Topics

#crypto

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

collection, crypto, ffi, js, meta, typed_data

More

Packages that depend on cryptography_plus