I'm Noah. I work as a HPC Cyber Security Engineer
ginsburgnm / pyseltongue Goto Github PK
View Code? Open in Web Editor NEWShamir Secret Sharing library
License: MIT License
Shamir Secret Sharing library
License: MIT License
I'm Noah. I work as a HPC Cyber Security Engineer
The library doesn't perform sanity checks on the user input. If the number of shares provided by the user is less than the threshold number required to recover the secret key, the library just hangs without any result (positive or negative).
Hello, is it possible to add Verifiable Secret Sharing functionality (of any type) to this library?
thanks.
I tried the hex example from https://github.com/ginsburgnm/pyseltongue#hex-secrets on windows 11 python 3.11
in the documented output, the shares are of the same length as the secret.
When I run it what happens is that the produced shares are of longer size then the secret. How can this be avoided?
from pyseltongue import SecretSharer
shares=SecretSharer.split_secret("c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a", 2, 3)
print(len("c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a"))
# even longer when prefix removed
print(len(shares[0][2:]))
>>>64
>>>78
Is it somehow possible to influence the produced shares length?
I was working with a 3 of 5 split of shares. The only combination of shares that produces the correct key was 0,1,2. Any other order or combination produced different results.
Hi,
Thank you publishing for your great library for secret sharing.
When I using PlaintextToHexSecretSharer class I got a bug.
You can check this by using this key = '0B4A30EEFEBA6783EA68F79AD5DC85E4DDCD83D4'
My result is following
Mykey = 0B4A30EEFEBA6783EA68F79AD5DC85E4DDCD83D4
Shares = ['1-bcea3e58f116fb8c28151ce22bb6a45a35f610119e0e60211bb6d658258f06c2360b207e91f17da2', '2-79d47cb1e22df7151d2edcd9b8751be52c2999dcba6c258d0e7eea2fc30674775176a63bbf7615b9', '3-36bebb0ad344f29e12489cd145339370225d23a7d6c9eaf90146fe07607de22c6ce22bf8ecfaadd0', '4-f3a8f963c45bee2707625cc8d1f20afb1890ad72f327b064f40f11defdf54fe1884db1b61a7f4602', '5-b09337bcb572e9affc7c1cc05eb082860ec4373e0f8575d0e6d725b69b6cbd96a3b937734803de19']
AfterRecombinig = B4A30EEFEBA6783EA68F79AD5DC85E4DDCD83D4
After recombining 0 doesn't show up
key = b'\xf6\xb0\x0c\x14?c~\x83\xf0\xeb#f\x88\x8d\x1c\x02\x87\x8d\xc3#f\x14\x86H\xf0\x8f\xeag\xc8pL\xdd'
key = key.hex()
shares = SecretSharer.split_secret(key, 2, 2)
recovered_key = SecretSharer.recover_secret(shares)
print(recovered_key)
## 6b00c143f637e83f0eb2366888d1c02878dc32366148648f08fea67c8704cdd (without f at starting)
print(key)
## f6b00c143f637e83f0eb2366888d1c02878dc32366148648f08fea67c8704cdd
recovered_key = bytes.fromhex(recovered_key)
## getting error here because of odd length string
## ValueError: non-hexadecimal number found in fromhex() arg at position 63
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.