cryptography 0.2.3 copy "cryptography: ^0.2.3" to clipboard
cryptography: ^0.2.3 copied to clipboard

outdated

Cryptography for applications. Key exchange (X25519, ECDH-P256, etc.), encryption (AES, Chacha20), and cryptographic hash functions (Blake2s, SHA2). Web Crypto API support.

example/example.dart

import 'package:cryptography/cryptography.dart';

Future<void> main() async {
  // Generate a random 256-bit secret key
  final secretKey = await chacha20.newSecretKey();

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

  // Encrypt
  final result = await chacha20Poly1305Aead.encrypt(
    [1, 2, 3],
    secretKey: secretKey,
    nonce: nonce,
  );
  print('Bytes: ${result.cipherText}');
  print('MAC: ${result.mac}');
}
264
likes
0
pub points
97%
popularity

Publisher

verified publisherdint.dev

Cryptography for applications. Key exchange (X25519, ECDH-P256, etc.), encryption (AES, Chacha20), and cryptographic hash functions (Blake2s, SHA2). Web Crypto API support.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, crypto, js, meta, typed_data

More

Packages that depend on cryptography