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

outdated

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);

Signing and Verifying #

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

  String signature = rsaKeypair.privateKey.createSignature(message);
  bool verified = rsaKeypair.publicKey.verifySignature(message, signature);
Using EC
  ECKeypair ecKeypair = ECKeypair.fromRandom();
  String message = DateTime.now().millisecondsSinceEpoch.toRadixString(16);

  String signature = ecKeypair.privateKey.createSignature(message);
  bool verified = ecKeypair.publicKey.verifySignature(message, signature);
62
likes
40
pub points
93%
popularity

Publisher

verified publisherkonstantinullrich.de

A simple Dart library for asymmetric encryption and digital signatures

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

asn1lib, pointycastle

More

Packages that depend on crypton