curve25519 1.0.0

  • Example
  • Installing
  • Versions
  • 63

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.


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(
  print("#1 -> #2: ${sharedSecret.toHex()}");

  sharedSecret = await X25519().calculateSharedSecret(
  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:

  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';
Version Uploaded Documentation Archive
1.0.0 Jun 11, 2019 Go to the documentation of curve25519 1.0.0 Download curve25519 1.0.0 archive
0.1.0 Apr 2, 2019 Go to the documentation of curve25519 0.1.0 Download curve25519 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.3.2
  • pana: 0.12.18


Detected platforms: Flutter, web, other

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

Maintenance issues and suggestions

Provide a file named (-20 points)

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


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