Threshold Secret Sharing (Shamir's secret sharing scheme)
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
COPYING
Makefile
README.md
setup.py
tss.py
tss_test.py

README.md

Threshold Secret Sharing

Implementation of Shamir's secret sharing scheme http://tools.ietf.org/html/draft-mcgrew-tss-03

Requirements

Python ≥ 2.6 (also compatible with Python 3.x)

Install

$ sudo pip install tss

Example

import tss
# Create 8 shares of the secret recoverable from at least 5
# differents shares. Use secretid42 as identifier and hash the
# secret with sha256.
shares = tss.share_secret(5, 8, 'my shared secret', 'secretid42',
                          tss.Hash.SHA256)
try:
    # Recover the secret value
    secret = tss.reconstruct_secret(shares)
except tss.TSSError:
    pass  # Handling error

Notes

  • Operations are not constant-time, and are quite verbose too
  • This implementation doesn't provide ECC encoding/decoding

License

MIT License