Git Product home page Git Product logo

secretsplitter's Introduction

This repository contains several projects:

* SecretSplitter - This is the DLL that contains the SecretSplitter and SecretCombiner classes for splitting and combining secrets
* SecretSplitterGui - This is a prototype GUI that uses the SecretSplitter classes.
* Ssss - A from-scratch compatibile implementation of B. Poettering's ssss-split and ssss-combine utilities
* UnitTests - Various unit tests for SecretSplitter's classes.

Everything is subject to the MIT License. See License.txt

For more details on how SecretSplitter works and how to use it, see

http://www.moserware.com/2011/11/life-death-and-splitting-secrets.html

secretsplitter's People

Contributors

moserware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

secretsplitter's Issues

Problem with SecretSplitter/SecretCombiner when secretMessage starts with zeros

If byte array parameter secretMessage has zeros at start then reconstructed secret doesn't have those leading zeros.
Example code
byte[] secret = new byte[] { 0x00, 0x00, 0x00, 0x05 };
SplitSecret splitSecret = SecretSplitter.SplitMessage(secret, 3);
IEnumerable secretShares = splitSecret.GetShares(5);
List shares = secretShares.Select(i => i.ToString()).ToList();
CombinedSecret combinedSecret = SecretCombiner.Combine(shares.Take(3));
byte[] result= combinedSecret.RecoveredBytes; //result length is 1

Various secret recovery issues

There are two demonstrable flaws in the secret generation process (for files) and the secret recovery process (files & text secrets):

  1. If a binary secret begins with 0x00, the generated shares are not valid, in that they do not recover the secret.
  2. Secrets have about a .4% probability of generating shares which, though valid, do not result in recovery of the secret when input to the program's recovery process.

Case 1 is the more serious bug, because the program generates a binary secret to serve as the master password when encrypting files. The generated secret has a 1/256 probability of starting with 0x00, in which case the file cannot be recovered with the shares the program creates. There is no workaround to recover the file given only the encrypted file and the shares.

Case 2 behavior creates shares properly, but when input to the program cause the wrong secret to be produced. The shares themselves are provably correct, since they produce the proper output when input to another ssss implementation (ssss-combine, for example). Since case 2 occurs with about the same probability as case 1 (1/256 = .39%), this may be related in some way to the leading zero problem.

In the case of text secrets, the workaround is to use another ssss implementation to recover the secret (e.g. ssss-combine).

I am not aware of any workaround for case 1, since the shares themselves are invalid. This is unfortunate because it likely means there is no fix to the program which will enable it to recover a file encrypted using the damaged shares, nor will any 3rd party tool help. On the other hand, the program could be modified to prevent use of 0x00 as the leading byte of the master encryption key for files, which would at least in theory prevent the creation of invalid file shares in future use.

EDIT: Here are some samples of secret strings which reproduce the case 2 scenario (split into 3 pieces such that any 2 can be used to restore the secret).

    suqlxK5FeWDH
    DFXKY6cxehBW
    1XhbBgRYrQ0k
    exROzCAEFDqC
    ipLph6AT43TF
    PM5QuqUiGCT4

The shares created will properly reconstruct the secret in ssss-combine, but not in this Secret Splitter program. You can use the ssss demo program here:http://point-at-infinity.org/ssss/demo.html to see what the proper reconstruction of the secret looks like using shares created by Secret Splitter.

Interestingly, the shares created by the Web demo of ssss also fail to recreate the secret in Secret Splitter, resulting in the same garbled output value. Hence, the shares are valid, but the recovery process is flawed.

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.