crypton 2.2.1 copy "crypton: ^2.2.1" to clipboard
crypton: ^2.2.1 copied to clipboard

A simple Dart library for asymmetric encryption and digital signatures

example/README.md

Examples #

Encryption and Decryption #

  RSAKeypair rsaKeypair = RSAKeypair.fromRandom();
  String message = DateTime.now().millisecondsSinceEpoch.toRadixString(16);

  String encrypted = rsaKeypair.publicKey.encrypt(message);
  String decrypted = rsaKeypair.privateKey.decrypt(encrypted);
copied to clipboard

Signing and Verifying #

Using RSA
  RSAKeypair rsaKeypair = RSAKeypair.fromRandom();
  String message = DateTime.now().millisecondsSinceEpoch.toRadixString(16);

  String signature = rsaKeypair.privateKey.createSHA256Signature(utf8.encode(message) as Uint8List);
  bool verified = rsaKeypair.publicKey.verifySHA256Signature(message, signature);
copied to clipboard
Using EC
  ECKeypair ecKeypair = ECKeypair.fromRandom();
  String message = DateTime.now().millisecondsSinceEpoch.toRadixString(16);

  String signature = ecKeypair.privateKey.createSHA256Signature(utf8.encode(message) as Uint8List);
  bool verified = ecKeypair.publicKey.verifySHA256Signature(message, signature);
copied to clipboard
63
likes
130
points
13.5k
downloads

Publisher

verified publisherkonstantinullrich.de

Weekly Downloads

2024.09.11 - 2025.03.26

A simple Dart library for asymmetric encryption and digital signatures

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

asn1lib, pointycastle

More

Packages that depend on crypton