Home

Awesome

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

License

MIT License