Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Latest commit

 

History

History
37 lines (31 loc) · 1.39 KB

README.md

File metadata and controls

37 lines (31 loc) · 1.39 KB

ed25519_dart

Pure Dart implementation of Ed25519 - public-key signature system. For more information, please follow here.

In general, code mimics behaviour of original Python implementation with some extensions from ActiveState Code Recipes. Code is not tested for security requirements, so it is good idea to use it on trusted local machines!

Usage

A simple usage example:

    import 'package:ed25519_dart/ed25519_dart.dart';
    
    void main() {
      // Create new random secret key
      var sk = secretKey();
      print("Created random secret key with length - ${sk.length}");
      // Derive public key from secret key
      var pk = publicKey(sk);
      print("Derived public key with length ${pk.length} from secret key");
      // Create simple message from list
      var msg = bytesFromList([1, 2, 3, 4]);
      print("Created simple message - $msg");
      // Sign message with pk secret ley and public key
      var signature = sign(msg, sk, pk);
      print("Message signed by secret and public key");
      // Verify message signature with public key
      var isVerified = verifySignature(signature, msg, pk);
      print("Created signature is verified - $isVerified");
    }

Package documentation

Extended package documentation can be found here.