Giter Site home page Giter Site logo

pyseltongue's Introduction

pyseltongue's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyseltongue's Issues

recover_secret returns odd length string sometimes

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

share length changed

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?

Got a bug

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.