Code Monkey home page Code Monkey logo

shamir-secret-sharing-poc's Introduction

Shamir Secret Sharing Script (Proof of concept)

The following is POC for the final implementation of IMPLEMENTATION OF DECENTRALIZED CRYPTOGRAPHY USING SHAMIR’S SECRET SHARING ALGORITHM
Refer Abstract
Refer Presentation
Detailed Research description on Shamir Secret Sharing Algorithm
Complete Documentation and Codebase (of final implementation) will be opensourced soon.

Aim of this poc: To create a program implementing Shamir Secret Sharing Algorithm with the following features:

The applet should accept a byte array of size 32. 
For eg - private byte[] secret = new byte[32]; 
The applet should form 4 shares where the secret could be reconstructed from any 2 shares. 
Apply Shamir secret sharing scheme to each byte separately and use Galois Field(256) as the underlying finite field. 
Y coordinate corresponding to the same X coordinates shall be stored in the same byte array for each share. 
The applet should accept M number of byte array and reconstruct the original secret using Shamir’s Algorithm. 
Notes: No external library (accept for generating random numbers) shall be used.

Refer sss_with_gf256.py for the code

Used GF256 library for making operations over Galois Field(256).

The applet forms 4 shares where the secret can be reconstructed from any 2 shares. Shamir secret sharing scheme is applied to each byte separately and used Galois Field(256) as the underlying finite field.

By default a secret key is already defiled in the code. And reconstruction can be done by using any two shares. By default reconstruction is done using share3 & share4. Refer comments within the code for more explanation.
main_code

Instructions

  • Clone or download the repository
  • For first time, run this in Powershell
pip install gf256
  • Next do this to execute
python sss_with_gf256.py
  • make changes in the basecode based on the requirements

Output

Here is a snippet for output for the default input.
you can customise the input by editing the inputs within the code.
Refer comments in the code for more info
Output

shamir-secret-sharing-poc's People

Contributors

nitishgadangi avatar

Stargazers

 avatar  avatar

Watchers

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