crypton 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new75

Crypton #

A simple Dart library for asymmetric encryption and digital signatures

This library is a simplified interface to interact with the pointy castle

Features #

RSA #

  • Generate random a RSAKeypair
  • Sign messages
  • Validate Signatures
  • Encrypt and Decrypt messages

EC #

  • Generate random a ECKeypair
  • Sign messages
  • Validate Signatures

See more #

To see more take a look at the examples

1.0.1 #

  • Add Documentation

1.0.0 #

  • Update README, Ready for Version 1.0.0

0.0.5 #

  • Update Code Format

0.0.4 #

  • Add ECKeypair with Random Key-generation
  • Add ECSignature creation and Signature validation

0.0.3 #

  • Update Code Format

0.0.2 #

  • Add Example overview

0.0.1 #

  • Add RSAKeypair with Random Key-generation
  • Add RSASignature creation and Signature validation
  • Add encryption using RSA

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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  crypton: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:crypton/crypton.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
asn1lib ^0.5.14 0.5.15
pointycastle ^1.0.2 1.0.2
Dev dependencies
test ^1.6.0