hbs / pyssss Goto Github PK
View Code? Open in Web Editor NEWPython Shamir Secret Sharing Scheme
Python Shamir Secret Sharing Scheme
The pickRandomPolynomial function ensures that the generated polynomial has a non-zero top coefficient. This isn't necessary, and actually causes a small information leak. If an attacker with k-1 keys runs them through the decode (and knows the value of k), he can say for certain that none of the bytes of the resulting secret are correct. Ideally, about 1/256 of them should be correct (but the attacker of course won't know which), which is what you get if you allow the top coefficient to be zero.
random.randint()
is used to generate pseudo numbers for non security sensitive applications, random()
is being used in this program and it is a security risk.
"Warning The pseudo-random generators of this module should not be used for security purposes. Use os.urandom()
or SystemRandom
if you require a cryptographically secure pseudo-random number generator." https://docs.python.org/2/library/random.html
I can't get this to work for k = 2. (Where you want 2 of n to reveal the secret.)
Here's a testcase:
Edit the test at the bottom of PySSSS.py to set k=2 instead of k=3.
Now run "python PySSSS.py".
Result: it spits out garbledegook.
Now edit it back to say k=3, and it works.
Could you allow the customization of other suitable modulo polynomials except x^8+x^4+x^3+x+1 ? Because that will create a wider variety of "Cipher text" or "Salt" so it will be harder to crack.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.