curve25519 1.0.0

Pub Package

Introduction #

A Dart package that implements X25519 key exchange (RFC 7748). X25519 is Elliptic Curve Diffie-Hellman (ECDH) over Curve25519.

Supports all platforms, including browsers.

Authored by terrier989. Licensed under the Apache License 2.0.

Contributing #

Tests #

  • We use:
    • Test vectors from the RFC.
    • An additional 10,000 rounds test vector.
  • Performance (on a recent Intel CPU) is about 1k operations per second.

example/curve25519.dart

import 'package:curve25519/curve25519.dart';

void main() async {
  // Let's generate two asymmetric keypair.
  final keypair1 = await X25519().generateKeyPair();
  final keypair2 = await X25519().generateKeyPair();

  // We can now calculate a shared secret using the (sender's) private key and
  // the (recipient's) public key.
  var sharedSecret = await X25519().calculateSharedSecret(
    keypair1.secretKey,
    keypair2.publicKey,
  );
  print("#1 -> #2: ${sharedSecret.toHex()}");

  sharedSecret = await X25519().calculateSharedSecret(
    keypair2.secretKey,
    keypair1.publicKey,
  );
  print("#2 -> #1: ${sharedSecret.toHex()}"); // Same as #1 --> #2
}

Use this package as a library

1. Depend on it

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


dependencies:
  curve25519: ^1.0.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:curve25519/curve25519.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

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

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
benchmark_harness ^1.0.0
pedantic ^1.0.0
raw ^0.2.0
test ^1.4.0

Admin