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

outdated

Popular cryptographic algorithms. Enables you to do key agreement, digital signature, encryption, message authentication, and hashing.

example/lib/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 clearText = [1, 2, 3];
  final cipherText = await chacha20Poly1305Aead.encrypt(
    clearText,
    secretKey: secretKey,
    nonce: nonce,
  );

  print('Bytes: ${chacha20Poly1305Aead.getDataInCipherText(cipherText)}');
  print('MAC: ${chacha20Poly1305Aead.getMacInCipherText(cipherText)}');
}
264
likes
0
pub points
97%
popularity

Publisher

verified publisherdint.dev

Popular cryptographic algorithms. Enables you to do key agreement, digital signature, encryption, message authentication, and hashing.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, crypto, js, meta, typed_data

More

Packages that depend on cryptography