Giter VIP home page Giter VIP logo

secret-sharing's Introduction

This is an implementation of Shamir Secret Sharing Scheme.

Only standard python libraries are being used. 
No need to install additional modules.

Demo available for Graphical User Interface (GUI):
http://youtu.be/FajKgzJ0KiE 
Command Line Interface (CLI): 
http://youtu.be/zR7GKyLYBYM

The program consists of following files:
interpolate.py: file that contains the interpolate class
secret.py: file that contains the class to generate a secret
threshold_scheme.py: contains functions to recover and generate secrets. 
GUI.py: User Interface for the program

**********************************************************
To run, go to the code directory and type into command line:

python GUI.py

1) To generate shares, input: 
Number of total shares 
Number of required shares
Secret string consisting of ASCII characters.

2) To recover secret: provide shares that are enough to recover the secret.

**********************************************************
Optionally, the program can be run from the command line.

1) To generate shares, use:  
python theshold_scheme.py generate <filename> -o <output>
<filename> must be a text file with: 
1st line = required number of shares
2nd line = total number of shares
3rd line = secret passphrase
<output> is a name of a file where shares will be written to.

2) To recover shares, use: 
python theshold_scheme.py recover <filename> -o <output>
<filename> must be a text file with separate share on each line.
<output> is a name of a file where secret will be written to.


Author: Samir Khakimov

secret-sharing's People

Contributors

skhakimov avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

secret-sharing's Issues

Python 3.6.x compatibility

Needs some changes to get working with Python >3.6.x

  • Each line should be terminated in a newline character
  • Use range instead of xrange
  • Use print('Need more shares to recover!')

The GUI needs more work between Python 2.x and Python 3.x like:

try:
from Tkinter import *
except ImportError:
from tkinter import *

only one share is generating

when i'm executung through CLI it is generating only one share in the output file..
the below is the error code while executing through CLI..
the GUI part works very well.. thanks

root@kali:~/Downloads/secret-sharing-master# python threshold_scheme.py generate input -o output
Traceback (most recent call last):
File "threshold_scheme.py", line 134, in
main()
File "threshold_scheme.py", line 121, in main
output.write("%d-%s" % (share,shares[share])+'\n')
ValueError: I/O operation on closed file

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.