Skip to content
/ tss Public

Threshold Secret Sharing (Shamir's secret sharing scheme)

License

Notifications You must be signed in to change notification settings

seb-m/tss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Threshold Secret Sharing (Shamir's secret sharing scheme)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages