Live data from Hacker News

Shamir Secret Sharing

max.levch.in

21–30 of 69 posts

Re: Shamir Secret Sharing

#21
post #16

Is there an alternative scheme that allows the different parties to enter their own password?

Not with passwords of their choice. You could use SSS in combination with BIP to derive a set of 12 or 24-word passphrases, this might be a bit more user friendly.

can you give more information please?

Re: Shamir Secret Sharing

#23

Now we have HashiCorp Vault that serves this purpose and uses shamir.

Yes, I agree, HashiCorp Vault definitely serves the purpose of having a single point of failure that can go down and take your entire company down with it, just like in the story :P (c.f. Roblox)

Re: Shamir Secret Sharing

#25

Now we have HashiCorp Vault that serves this purpose and uses shamir.

Yes, I agree, HashiCorp Vault definitely serves the purpose of having a single point of failure that can go down and take your entire company down with it, just like in the story :P (c.f. Roblox)

Aaah, we had something like this happen to a k8s cluster that had secrets stored in a HC Vault. The vault got sealed and the keys lost.

That was it...

Re: Shamir Secret Sharing

#26
post #7

For those who would like to play around with Shamir secret sharing, here is a Python implementation I wrote to check out something I was curious about [1]. Note: requires at least Python 3.8. The function make_sss(secret, num_shares, p=0) makes a polynomial for sharing the given secret that requires num_shares shares to recover. P is the prime. If p is 0 then make_sss will pick a random prime large enough for the sec…

Nice! When I first heard of SSS, but before I looked it up, this was my assumption for how it worked. Seems just as good as polynomial interpolation.

Re: Shamir Secret Sharing

#27
post #19
post #11

Does this count as an instance of 'don't roll your own crypto'?

Not at all. The problem was that the crypto for the same library on two different OSes was implemented differently, which lead to an error encrypting on Linux and decrypting on Solaris. Ironically, this would have been avoided if they had rolled their own. It is an instance of "make sure you have backups when deploying to production"

Not the crypto, but rather the getpass() function, which simply reads a password from standard input without echoing it.

Since the function uses a static buffer, there is a limit on the password length, which apparently on Solaris was set to the absurdly low value of 8 (glibc uses a more reasonable value: 8192).

Re: Shamir Secret Sharing

#28
post #9

OK, since we're pitching our SSS implementations here in comments, I welcome everyone to check out BananaSplit, https://bs.parity.io Not sure about year 2023, but at the time I wrote it for my previous employer there was nothing remotely usable for regular user. Thus, BananaSplit. It doesn't allow you to specify many parameters (just the number of shards, and then requires 50%+1 to recover); aimed at printed backups…

Interesting idea, but the restore function doesn't work for me.

    Access to fetch at 'file://redacted/Banana%20split.html#/combine' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.

Re: Shamir Secret Sharing

#29
Great story! It made me super nervous all the way.

I also built a pure python lib a whole ago to use w/ an app, check it out: https://github.com/HacKanCuBa/secretshare-py It uses prime arithmetic, which limits severally the input size, but it works pretty well and fast. Not production ready BC I haven't tested it enough, but it is a good starting point.

Re: Shamir Secret Sharing

#30
post #11

Does this count as an instance of 'don't roll your own crypto'?

I think it's more of an instance of "it works on my computer"; not testing on an environment sufficiently similar to production, and applying a change that cannot be rolled back.
Post reply on HN