curve25519 2.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

Introduction #

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

This package has been merged into package:cryptography.

2.0.0 #

  • Merged the package into the new package:cryptography, which will contain various algorithms. This old package will just export implementation from the new package.


import 'package:curve25519/curve25519.dart';

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

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

  sharedSecret = x25519.sharedSecret(
  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: ^2.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';
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 Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

1 out of 1 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: cryptography.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
cryptography any 0.2.6
Transitive dependencies
charcode 1.1.3
collection 1.14.12
convert 2.1.1
crypto 2.1.4
js 0.6.1+1
meta 1.1.8
pointycastle 1.0.2
typed_data 1.1.6
Dev dependencies
pedantic ^1.0.0