Search packages, repositories and app categories

Package detailsv0.3.2

ed25519_edwards

Dart port of ed25519 from Go Cryptography ed25519

AndroidiOSWebmacOSWindowsLinux
30-day downloads
742K
Likes
13
Pub points
160

Install package

flutter pub add ed25519_edwards

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Dart implementation of the ed25519 Edwards curve digital signature algorithm, ported from Go's cryptography library. It provides secure, high-performance signing and verification for cryptographic applications. The package supports multiple platforms including mobile, web, and desktop, making it suitable for cross-platform apps requiring strong authentication and data integrity. It follows the standard ed25519 specification, ensuring compatibility with other implementations.

Use cases

  • Secure digital signatures in apps
  • User authentication with key pairs
  • Cryptographic verification of messages
  • Blockchain and wallet integrations
  • Secure API communication

Key features

  • Cross-platform support
  • High performance
  • Standard-compliant ed25519 implementation
  • Lightweight and efficient
  • Supports key generation, signing, and verification

Suitable for

  • Developers building secure apps
  • Blockchain and crypto projects
  • Applications needing strong authentication
  • Teams using Dart/Flutter for backend or frontend security

Considerations

  • Requires understanding of cryptographic principles
  • Not suitable for raw encryption
  • Best used with proper key management practices
  • Limited to signature operations, not general encryption

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Ed25519

Dart port of ed25519 from Golang ed25519

Pub package

Usage


import 'package:ed25519_edwards/ed25519_edwards.dart' as ed;

    void signAndVerify() {
      var keyPair = ed.generateKey();
      var privateKey = keyPair.privateKey;
      var publicKey = keyPair.publicKey;
      var message = utf8.encode('test message');
      var sig = ed.sign(privateKey, message as Uint8List);
      var result = ed.verify(publicKey, message, sig);
      assert(result == true);
    
      var wrongMessage = utf8.encode('wrong message');
      var wrongResult = ed.verify(publicKey, wrongMessage as Uint8List, sig);
      assert(wrongResult == false);
    }

APIs

Ed25519
public
seed
newKeyFromSeed
generateKey
sign
verify
Edwards25519
FeZero
FeOne
FeAdd
FeSub
FeCopy
FeCMove
FeFromBytes
FeToBytes
FeIsNegative
FeIsNonZero
FeNeg
FeCombine
FeMul
FeSqaure
FeSquare2
FeInvert
GeDoubleScalarMultVartime
PreComputedGroupElementCMove
GeScalarMultBase
ScMulAdd
ScReduce
ScMinimal

Benchmark

Simulate from pinenacl-dart Benchmark

MacBook Pro (16-inch, 2019), macOS Big Sur, with 2.4GHz i9 32GB

JiT (Dart VM) Benchmark

dart test test/benchmark/ed25519_benchmark.dart

type rate iterations time data throughput
Ed25519 - sign 50.54 MB/s 254 iterations 5025 ms 254.00 MB
Ed25519 - verify 97.38 MB/s 487 iterations 5001 ms 487.00 MB
AoT (native binary)

dart2native test/benchmark/ed25519_benchmark.dart -o ed25519_benchmark
./ed25519_benchmark

type rate iterations time data throughput
Ed25519 - sign 21.64 MB/s 109 iterations 5036 ms 109.00 MB
Ed25519 - verify 37.20 MB/s 187 iterations 5027 ms 187.00 MB
JS (Dart2JS) benchmark (too slow, suggest using other libs for dart2js and flutter web)

dart test test/benchmark/ed25519_benchmark.dart -p chrome

type rate iterations time data throughput
Ed25519 - sign 797.03 KB/s 4 iterations 5139 ms 4.00 MB
Ed25519 - verify 1.53 MB/s 8 iterations 5231 ms 8.00 MB

Categories

Dependencies

Dependency list 4 items

Source repository

Projects using this package