Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 885 Bytes

README.md

File metadata and controls

28 lines (23 loc) · 885 Bytes

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