Coder Social home page Coder Social logo

secret-sharing-dart's Introduction

secret-sharing-dart

Build Status Coverage Status

Warning: This implementation has not been tested in production nor has it been examined by a security audit. All uses are your own responsibility.

This library is an implementation of Shamir's Secret Sharing Algorithm. It also uses the Converter and Codec framework of dart:convert.

To encode a secret, first import the library:

import 'package:secret_sharing/secret_sharing.dart';

If you want to encode an int-Secret, you'll have to use the RawShareCodec. Otherwise, use the StringShareCodec.

Usage of the RawShareCodec

Encoding

var codec = new RawShareCodec(3, 2);
var shares = codec.encode(900000000000000);

This produces shares in the form of x-y, where x and y are hex values.

Decoding

var decoded = codec.decode(shares);

This should reproduce the secret int (if the number of given shares is sufficient).

Usage of the StringShareCodec

Encoding

The StringShareCodec needs a charset as initialization parameter. If you want to use an adaptive charset based on the secret you want to encode then use the bySecret-Constructor. Otherwise, pass the Charset to the constructor (an included Charset is the ASCIICharset).

Having obtained the codec, you can encode and decode like described before.

Decoding

Decoding works the same as for RawShares.

Command Line Tools

For the command line, there are two tools: The secret_encoder and the secret_decoder. Those tools enable quick access for share generation and secret recovering and have both an included help via --help.

Btw, this library is compatible to flower-pot's Ruby implementation of Shamir's Secret Sharing.

secret-sharing-dart's People

Contributors

adracus 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.