eosdart_ecc 0.4.0

Elliptic curve cryptography (ECC) in Dart #

Elliptic curve cryptography lib for EOS based blockchain in Dart lang.

Build Status

Usage #

A simple usage example:

import 'package:eosdart_ecc/eosdart_ecc.dart';

main() {
  // Construct the EOS private key from string
  EOSPrivateKey privateKey = EOSPrivateKey.fromString(
      '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3');

  // Get the related EOS public key
  EOSPublicKey publicKey = privateKey.toEOSPublicKey();
  // Print the EOS public key
  print(publicKey.toString());

  // Going to sign the data
  String data = 'data';

  // Sign
  EOSSignature signature = privateKey.signString(data);
  // Print the EOS signature
  print(signature.toString());

  // Verify the data using the signature
  signature.verify(data, publicKey);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

References #

eosjs-ecc: https://github.com/EOSIO/eosjs-ecc

0.4.0 #

  • fix signature bug

0.3.2 #

  • fix signature bug

0.3.1 #

  • sign method will sign Uint8List
  • add signString method which signs String

0.3.0 #

  • Support canonical signature

0.2.2 #

  • Healthy change

0.2.1 #

  • Add CHANGELOG.md

0.2.0 #

  • EOSPublicKey, EOSPrivateKey, EOSSignature
  • Sign the data
  • Verify the signature

0.1.0 #

  • Initial version, created by Stagehand

example/eosdart_ecc_example.dart

import 'package:eosdart_ecc/eosdart_ecc.dart';

main() {
  // Construct the EOS private key from string
  EOSPrivateKey privateKey = EOSPrivateKey.fromString(
      '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3');

  // Get the related EOS public key
  EOSPublicKey publicKey = privateKey.toEOSPublicKey();
  // Print the EOS public key
  print(publicKey.toString());

  // Going to sign the data
  String data = 'data';

  // Sign
  EOSSignature signature = privateKey.signString(data);
  // Print the EOS signature
  print(signature.toString());

  // Verify the data using the signature
  signature.verify(data, publicKey);
}

Use this package as a library

1. Depend on it

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


dependencies:
  eosdart_ecc: ^0.4.0

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:eosdart_ecc/eosdart_ecc.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
52
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]
76
Learn more about scoring.

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

  • Dart: 2.5.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:eosdart_ecc/eosdart_ecc.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
bs58check ^1.0.1 1.0.1
pointycastle ^1.0.1 1.0.1
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
hex 0.1.2
typed_data 1.1.6
Dev dependencies
test ^1.0.0