dart_ssss 0.0.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 50

dart_ssss

Build Status Coverage Status

A Dart library that implements Shamir's Secret Sharing Scheme over GF(256).

Given a secret in bytes, this package can assist in splitting up the secret into n parts and would be able to reconstruct the secret in bytes given a t threshold.

I would highly recommend you look at the the wikipedia page above to learn about the workings of Shamir's Secret Sharing Scheme.

Getting Started

To use dart_ssss, add it to your dependencies in pubspec.yaml:

dependencies:
    dart_ssss: any

Then import the proper package:

import 'package:dart_ssss/dart_ssss.dart';

Usage

To generate shares / parts for a secret of bytes:

void main() {
    
    List<int> secretInByteValues = [...];
    
    SecretScheme ss = new SecretScheme(numberOfPartsToGenerate, thresholdForJoining);
    
    Map<int, List<int>> shares = ss.createShares(secretInByteValues);
    
    ...
      
     

To combine shares to regenerate a secret:

    List<int> recombinedSecretInBytes = ss.combineShares(shares);
}

Tests

To run tests on this package:

    pub run test 

in the package directory.

Limitations / Caveats

Given that the package is implemented over GF(256), it means that the max number of shares / parts it can generate is 255. With that said, it is not advisable to generate 255 shares / parts as an adversary can forge a secret.

Shamir's Secret Sharing Scheme does not guarantee integrity, so if you are looking for something where you can verify shares or the resulting secret, this package is not for you.

License

Copyright 2018 Gavin Ching

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Changelog

0.0.1

  • Initial version with all functionalities implemented.

0.0.2

  • Add coverage analysis through Coveralls (tool/coveralls.sh) and have more tests for higher coverage.
  • Better readme.

0.0.3

  • Fix issue of possibly return a 0 x coordinate as a share.
  • Add in branches of code to ensure that it will be tested later on (lowering coverage).

0.0.4

  • Remove random byte method from ByteHelper and create ByteRandom singleton to be used to generate random bytes.
  • Add mocks to tests to properly test edge cases involving specific random bytes.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_ssss: "^0.0.4"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_ssss/dart_ssss.dart';
        
Version Uploaded Documentation Archive
0.0.4 Mar 25, 2018 Go to the documentation of dart_ssss 0.0.4 Download dart_ssss 0.0.4 archive
0.0.3 Mar 25, 2018 Go to the documentation of dart_ssss 0.0.3 Download dart_ssss 0.0.3 archive
0.0.2 Mar 24, 2018 Go to the documentation of dart_ssss 0.0.2 Download dart_ssss 0.0.2 archive
0.0.1 Mar 22, 2018 Go to the documentation of dart_ssss 0.0.1 Download dart_ssss 0.0.1 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
50
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:dart_ssss/dart_ssss.dart.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dart_ssss.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
Dev dependencies
mockito any
test ^0.12.0