Skip to main content

Split secrets into T pieces, or recover split secrets by recombining any D pieces.

Project description

Split secrets into T pieces. The secret can be recovered by recombining any D pieces.

Overview (wikipedia)

This module implements:

Splitting is done by:

  1. Apply a random mask to the secret
  2. For each block of the mask, generate a polynomial of degree D-1
  3. A piece consists of the masked secret and one point of each polynomial

Recovering is done by:

  1. Collect D pieces: D polynomials for each block of the mask
  2. Interpolate the points to retrieve the blocks of the mask
  3. Recover the secret by re-applying the mask to the masked version

A puzzle piece is a yaml serialisation of the following mapping:

# string, tells if the secret encoded is a string encoded as UTF-8 ("utf-8") or a raw stream of bytes ("none")
encoding: utf-8

# one  puzzle piece, exact format depending on the implementation
# this implementation stores a sequence of [point, value] items, one per block of the secret
# Flow-sequence format preferred to keep it on one line
puzzle piece: [[1,258],[1,3]]

# base64 representation of the result of the mask XOR the byte representation of the secret
encoded secret: YXo=

# name of the algorithm used for splitting
algorithm: block-wise SSS

# different algorithms might add additional information required for recovering the secret.

Working on blocks makes the algorithm linear in the number of bytes of the secret rather than exponential.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secret_splitter-1.0.0.tar.gz (18.8 kB view hashes)

Uploaded Source

Built Distribution

secret_splitter-1.0.0-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page