Giter Site home page Giter Site logo

nacl_win's Introduction

nacl_win

A flutter plugin for Windows for generating Ed25519 keys and signing messages. It uses a Rust code and a generated .dll file. The flutter_rust_bridge plugin connects the Rust code to the Dart one.

Available methods:

  • generateKey() - generates a EdKeyPair. It is a struct that contains base64 strings of public and private Ed25519 keys.
  • signMessage(String message, String key) - Signs provided message with provided Ed25519 key.

Exceptions:

  • If the sodium library fails to initialize, the plugin throws a InitializationFailedException. Most likely the fault of this exception would be on the Rust crate side and it may not be related to plugin.
  • If the key provided to signMessage method is incorrect (too short, not base64, etc), the plugin will throw KeyDecodingFailedException as the Rust code fails to decode the key from base64 to vector.
  • If somehow the key decoding succeeds, but the Rust fails to transform the key from vector to sodium's SecretKey, the plugin will throw KeyTransformingFailedException.

Usage:

var key = await NaclWin.generateKey();
var sig = await NaclWin.signMessage('message', key.privKey);

For complete example see example/lib/main.dart

nacl_win's People

Contributors

gredajustyna avatar

Watchers

Robert Mitwicki avatar Michał Pietrus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.