Skip to content

Commit 00f1d85

Browse files
committed
Initial commit.
0 parents  commit 00f1d85

File tree

6 files changed

+450
-0
lines changed

6 files changed

+450
-0
lines changed

.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# General ignore rules
2+
3+
*.kpf
4+
*.o
5+
*.pyc
6+
*.a
7+
*~
8+
\#*
9+
*.log
10+
*.tmp
11+
*.bak
12+
a.out
13+
*.out
14+
*.so
15+
.#*
16+
docstrings/
17+
__pycache__/
18+
build/
19+
.DS_Store

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
clean:
3+
find . \( -name '*~' -or \
4+
-name '*.pyc' -or \
5+
-name '*.pyo' -or \
6+
-name '#*' -or \
7+
-name '.#*' -or \
8+
-name 'MANIFEST' -or \
9+
-name '*.so' \) \
10+
-print -exec rm {} \;
11+
rm -rf dist *build __pycache__

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Threshold Secret Sharing
2+
3+
Implementation of Shamir's secret sharing scheme [http://tools.ietf.org/html/draft-mcgrew-tss-03](http://tools.ietf.org/html/draft-mcgrew-tss-03)
4+
5+
## Example
6+
7+
import tss
8+
# Create 8 shares of the secret recoverable from at least 5
9+
# differents shares. Use secretid42 as identifier and hash the
10+
# secret with sha256.
11+
shares = tss.share_secret(5, 8, 'my shared secret', 'secretid42',
12+
tss.Hash.SHA256)
13+
try:
14+
# Recover the secret value
15+
secret = tss.reconstruct_secret(shares)
16+
except tss.TSSError:
17+
pass # Handling error
18+
19+
## Notes
20+
21+
* Operations are _not_ constant-time, and are quite verbose too
22+
* This implementation doesn't provide ECC encoding/decoding

setup.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python
2+
import sys
3+
if sys.version_info < (2, 6):
4+
sys.stderr.write('This module requires at least Python 2.6\n')
5+
sys.exit(1)
6+
7+
try:
8+
from setuptools import setup
9+
except:
10+
from distutils.core import setup
11+
12+
classif = [
13+
'Intended Audience :: Developers',
14+
'License :: OSI Approved :: MIT License',
15+
'Natural Language :: English',
16+
'Operating System :: OS Independent',
17+
'Programming Language :: Python',
18+
'Programming Language :: Python :: 2.6',
19+
'Programming Language :: Python :: 2.7',
20+
'Programming Language :: Python :: 3',
21+
'Programming Language :: Python :: 3.0',
22+
'Programming Language :: Python :: 3.1',
23+
'Programming Language :: Python :: 3.2',
24+
'Programming Language :: Python :: 3.3',
25+
'Topic :: Security',
26+
'Topic :: Security :: Cryptography',
27+
'Topic :: Software Development :: Libraries',
28+
]
29+
30+
setup(
31+
name='tss',
32+
version='0.1',
33+
description=('Threshold Secret Sharing.'),
34+
author='Sebastien Martini',
35+
author_email='[email protected]',
36+
license='MIT License',
37+
classifiers=classif,
38+
url='http://github.com/seb-m/tss',
39+
py_modules=['tss'],
40+
)

0 commit comments

Comments
 (0)