Giter Club home page Giter Club logo

hasksplit's Introduction

HaskSplit

Split and Reconstruct files using Shamir's Secret Sharing Scheme. Implemented in Haskell.

HaskSplit allows you to split a file into multiple shares such that a predefined number of these shares can be used to reconstruct the original file.

Usage

There are only two commands: split and reconstruct

split requires 3 parameters - the file the split, total number of shares and the threshold for recontruction. You can optionally specify an output directory using -o option.

reconstruct command will take the original file name as an input and searches through the current directory (or a directory given by the -i command) to find all the file shares, and attempt to reconstruct them.

Example Usage

Let's split a secret mp3 file into 5 parts, and say 3 of them is required to reconstruct the original file.

hasksplit split splitme.mp3 5 3 -o ./outputFolder

You should now see 5 files in the ./outputFolder directory, with name of the form splitme.mp3.XXX, where XXX is between 001 and 255.

Now delete any 2 of the output files and run the following command

hasksplit reconstruct splitme.mp3 -i ./splitFolder -o ./reconstructFolder

and you should see your original mp3 file in ./reconstructFolder!

Limitations and Disclaimer

This program uses the GF(2^8) Galois Field, thus the maximum number of shares that can be produced is 255.

While the theory behind this (SSSS) is sound and this has passed some basic tests, please think very, very carefully before using this to split your Nuclear Armaggedon secret code.

Contributing and Critique

This program was written as part of my Haskell learning. The aim was to write a idiomatic Haskell program and explore several areas such as error handling, streaming, and command line parsing.

Therefore you are very encouraged to:

  • Critique my code and program design
  • Submit bug reports
  • Send in pull requests for additional features

If you'd like some features, feel free to file a request and I'll see what I can do :)

hasksplit's People

Stargazers

 avatar  avatar

Watchers

 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.