22 comments

  • 9467899876496 hours ago
    My masters thesis was on this! I created an app where you can store your data across all the common data storage providers (dropbox, google drive, onedrive, etc.) and used the secret sharing to aid with the encryption. The benefit was that:<p>- They could no longer read your data<p>- Additional redundancy (as you only need 2 to be available)<p>- Compared to other secure storage apps which rely on a master password, which if you forget, you are screwed, you could still use all the usual account recovery methods.
    • luxcem5 hours ago
      It seems like a cool idea, did you follow up with a product or an open source app?
      • 9467899876495 hours ago
        Unfortunately no, as most uni students my code was utterly terrible and the app itself was more of a PoC. This was 10 years ago though and it&#x27;s been on my mind since then, so i&#x27;ll surely pick it up some point, perhaps after my current start up.
  • phkahler1 hour ago
    This part:<p>&quot;The useful part is not that the secret is hard to compute from too few shares. It is that too few shares contain no information about the secret. With one share missing, every possible secret is still possible.&quot;<p>Reminds me of factoring numbers with the Quadratic Sieve or its variants. You find a system of congruences mod n that eventually allow you to compute prime factors, but until you have enough of them that isn&#x27;t possible. I&#x27;ve often wondered... Each congruence must contain <i>some</i> information right? What space are we reducing degrees of freedom in?<p>Same thing here, each piece restricts the space of polynomials, but does not restrict it enough to tell where the key crosses the axis.
  • Hypomixolydian3 hours ago
    Shamir saved my bottom once, by helping me reconstruct random password used for almost forgotten backup, suddenly needed to be restored at once. Thank God I distributed shares in my family, &quot;just in case&quot;.
  • c0l06 hours ago
    We use this technique in our team to distribute passphrases for our secondary secret stores (that contain instructions on how to access our primary secret stores) in a &quot;democratically secure and safe&quot; manner.<p><a href="https:&#x2F;&#x2F;packages.debian.org&#x2F;trixie&#x2F;ssss" rel="nofollow">https:&#x2F;&#x2F;packages.debian.org&#x2F;trixie&#x2F;ssss</a> is a nice and rather straightforward implementation.
  • _jackdk_13 hours ago
    This is such a cool technique, and you could even teach it in secondary schools as a neat thing computer scientists can do with polynomials.
    • naths887 hours ago
      I am a secondary math teacher and I do exactly this with my students. When working on retrieving the expression of an affine function, I tell them about Shamir&#x27;..., they choose a secret pin as the slope, generate two points, give them to two other students who have to pair together to find the pin again. The students are always very engaged.
  • ndr_9 hours ago
    Bruce Schneier described this in his seminal book Applied Cryptography, and HashiCorp Vault used to have an implementation in Go. On the practical side, I always wondered how large - in bits - the shares should be. One answer I got on a news group was &quot;1 bit more than the actual key length&quot;. Nowadays, I wonder how the quantum computing threat would inform 1) share size choice and 2) pro&#x2F;con Secret Sharing in general. Does anyone know?
    • ahazred8ta7 hours ago
      Plain vanilla Shamir is information-theoretic secure and is completely impervious to QC. I can take a 1-byte secret, make &#x27;threshold of 10&#x27; Shamir shares from it, give you 9 of the 1-byte shares, and no computer in the universe can determine the secret. (In practice, Shamir systems need to add a MAC or checksum as an integrity check, so IRL they&#x27;re a few bytes larger.)
    • plopilop7 hours ago
      You usually do secret sharing in a finite field because computers don&#x27;t like real numbers. The size of your share is a point (x, y), x can be small (typically log n in case of n participants), y is a random point in the field.<p>Since Shamir Secret Sharing is information-theoretically secure (if you do not know k points from the k-out-of-n secret then all secrets are equally plausible even when bruteforcing), the bitsize of your field can be whatever you want (but obviously bigger than the bitsize of your secret, you can&#x27;t hide 100 bits in a finite field of 5 elements).<p>Usually, you don&#x27;t want an attacker to be able to bruteforce your secret (while the scheme is ITS, your secret typically isn&#x27;t, e.g. the seed of your wallet), hence randomness can be added to your secret and the bitsize of the field is taken big enough to thwart these attacks.<p>Depending on your attack model, an 80-bits or 128-bits field is more than secure enough, hence a share bitsize slightly above 80 or 128 bits.<p>And regarding quantum computer, since the scheme is ITS no attacks can exist.
    • pdpi37 minutes ago
      Shamir&#x27;s is based on the fundamental theorem of algebra — you need <i>n+1</i> points to uniquely define a degree <i>n</i> polynomial. So you achieve an n of k setup by building a degree n-1 polynomial p(x) and taking k random points from that polynomial. The i-th share is just (xi, yi), so the number of bits is defined by the field you&#x27;re building the polynomial on. Because the field has to be wide enough to store the whole secret and you have to store two values (x, y), share sizes are at least two times the size of the secret. (You&#x27;ll want some sort of integrity check to make sure your share isn&#x27;t corrupted, though)<p>As I understand it, quantum computing changes nothing here — if you&#x27;re missing even one point, that last point could change the secret to anything at all, with no way to disambiguate.
    • proxysna8 hours ago
      I think hashicorp still have an implementation for vaults seal&#x2F;unseal process. Unless something changed ofc
    • dfox5 hours ago
      One point is that there is no reason for the entire secret to be one element of the underlying field, it can very well be a n-tuple of elements of a smaller field, with GF(2^8) being the somewhat obvious choice if you do not expect ridiculous numbers of shares, no need to deal with bignum math.
    • andreareina7 hours ago
      Do you remember why 1 bit more?
  • Cider998613 hours ago
    Here is Ente&#x27;s implementation: (<a href="https:&#x2F;&#x2F;2of3.ente.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;2of3.ente.com&#x2F;</a>)
    • Ajedi3248 minutes ago
      This is my favorite one yet, very user friendly. I only wish it was a bit more configurable. Ideally I&#x27;d be able to set up something like:<p><pre><code> 3 of 4: A B C D - OR - 2 of 3: E F G - AND - 1 of 1: H </code></pre> Or any similar combination. Maybe also with a way to name the cards so it&#x27;s clear exactly what&#x27;s needed when restoring.<p>Though there&#x27;s something to be said for the simplicity of the current design.
    • emmelaich11 hours ago
      There&#x27;s an implementation packaged up for most Linux distros: <a href="http:&#x2F;&#x2F;point-at-infinity.org&#x2F;ssss" rel="nofollow">http:&#x2F;&#x2F;point-at-infinity.org&#x2F;ssss</a>
    • ahazred8ta7 hours ago
      There are several browser-based versions which can be used online or downloaded to use offline.<p><a href="https:&#x2F;&#x2F;bs.parity.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bs.parity.io&#x2F;</a> -- <a href="http:&#x2F;&#x2F;passguardian.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;passguardian.com&#x2F;</a> -- <a href="https:&#x2F;&#x2F;iancoleman.io&#x2F;shamir&#x2F;" rel="nofollow">https:&#x2F;&#x2F;iancoleman.io&#x2F;shamir&#x2F;</a>
  • saidnooneever3 hours ago
    this is very nice explanation which needs no maths. really cool. I read about this a few times in articles without images etc and its hard to digest if you dont have a good background but this was wonderfully easy to understand. Thanks a lot.
  • l1am07 hours ago
    Years ago I build a little tool to run shamir secret sharing in the browser (can be used full offline, just download the page)<p><a href="https:&#x2F;&#x2F;simon-frey.com&#x2F;s4&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simon-frey.com&#x2F;s4&#x2F;</a>
    • xtracto2 hours ago
      Ha! Years ago i downloaded your page and stored it in some usb disks along with my kdb keepass database and a share of my password.<p>I gave that to some members of my family and instruct them to give them to my wife in case I die.<p>Thanks a lot Sir.
  • ghostfoxgod9 hours ago
    It&#x27;s an incredible technique, when I came across it, it just changed the way I thought of solving giving out keys without &quot;truly&quot; giving them out. This gave me confidence for eternalvault.app, a project of mine.
    • hamburglar2 hours ago
      I’ve been noodling over this exact business idea for a couple years! Part of my value prop was to make ops scale down to as close to zero as possible by having the encrypted data and most of the front end for accessing it live in S3 objects (or some similar mega-cheap object store). Aside from that, all you need is the dead man’s switch mechanism. And the secret fragments would live on QR codes that bring you to the static SPA with one of the fragments already loaded up, prompting you to scan more to complete the decryption.<p>Good work doing it. I guess now I don’t have to. :D You may have gained a customer from this HN thread.
  • 3eb7988a166311 hours ago
    Do the people who hold the root DNS keys do anything like this? Or is that too much complexity when a safe in a secure room works as an effective backup?
    • davkan8 hours ago
      They do something similar. Basically 5 people are needed in order to access the dns root keys plus some extra administrative&#x2F;witness people. 3 Crypto Officers with smartcards to unlock the hsm, 2 other officials to unlock the vault that contains the hsm and the vault that contains safety deposit boxes with the smartcards. There are 7 crypto officers, of which any three will do.<p><a href="https:&#x2F;&#x2F;www.cloudflare.com&#x2F;learning&#x2F;dns&#x2F;dnssec&#x2F;root-signing-ceremony&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.cloudflare.com&#x2F;learning&#x2F;dns&#x2F;dnssec&#x2F;root-signing-...</a>
  • cryptocod32 hours ago
    SSS is amazing, though managing shares over a long period (people come and go) and dealing with collusion risk can be rough.
  • Tepix6 hours ago
    Instead of going from two lines to curves, parabolas etc, couldn&#x27;t you also add another dimension instead?
    • nyeah50 minutes ago
      Yes?<p>If I use 3 shares and require all three to recover, then I think I could let the 3 points define a plane. Then the plane would intersect the axis at a unique point.<p>If I want 4 or more shares, I can make them by just generating more points on that same plane. Then I think any three of those should recover the secret. So it seems like that would all work about the same as with the polynomials? Then I can go to still more dimensions when I want to require more shares to reveal the secret.
    • nitnelave4 hours ago
      Two points make a line in any number of dimensions.
      • Levitz3 hours ago
        Yes, but without a specific plane to intersect with, that still doesn&#x27;t define a third point, if you want to check intersection with an axis, you&#x27;d need a third point in tridimensional space, for example.
      • cynicalkane3 hours ago
        Think GP is suggesting an N-dimensional plane in K&gt;N dimensions.
  • teravor14 hours ago
    if the secret is large usually it&#x27;s encrypted and the payload is distributed along with the shares of the key.<p>but you can also just use Reed-Solomon and split the payload, the difference with Shamir is that you lose information-theoretic security (you lose it the moment you use encryption anyway) and the payload also needs to undergo an all-or-nothing-transform (AONT).<p>AONT transforms the entire payload into an encrypted blob which also serves as its own key, a withheld piece is a de facto encryption key. this is required because Reed-Solomon can have pathological cases where pieces leak information.
    • colmmacc13 hours ago
      Reed-Solomon is an Erasure code, and I definitely wouldn&#x27;t look to that for Secret Splitting. Those leakage models are gnarly. But if you want something else that is more general - there are Monotone Span Programs. Seriously underused.
      • teravor13 hours ago
        <p><pre><code> &gt; Reed-Solomon is an Erasure code </code></pre> which shares the same math as Shamir<p><pre><code> &gt; Those leakage models are gnarly. </code></pre> AONT solves that by making any leak other than the totality meaningless
  • craintes8 hours ago
    I also had written an article on the subject a while ago if you want to dig a bit deeper: <a href="https:&#x2F;&#x2F;petal.cafe&#x2F;posts&#x2F;shamir&#x2F;" rel="nofollow">https:&#x2F;&#x2F;petal.cafe&#x2F;posts&#x2F;shamir&#x2F;</a>
  • freakynit7 hours ago
    This is such a cool neat trick.<p>Vibe-coded a little playground where you can generate secrets, see the polynomial, combine the secrets, and in general, play around:<p><a href="https:&#x2F;&#x2F;shamirs-secret-sharing.pagey.site" rel="nofollow">https:&#x2F;&#x2F;shamirs-secret-sharing.pagey.site</a>
  • compsciphd14 hours ago
    before I learned of shamir secret sharing, I wondered why one couldn&#x27;t do the same exact thing with a par2 like system (albiet with smaller pieces than a par2 system would traditionally have). i.e. you have X bits of data, you create Y*X&#x2F;N sized recovery blocks (where Y &gt; N). You hand each recovery block to individual users. and any N users can get together to recover the key and decrypt the contents.
    • namibj10 hours ago
      Well in theory the base math is indeed the same; unfortunately though the &quot;randomly chosen&quot; part of shamir&#x27;s secret sharing is fairly important to the security because information theoretic security of the scheme requires each fragment to be as large as the original secret by way of essentially including a desired count of random data blocks to the original before applying the reed-solomon-like erasure coding to it where now enough fragments to reconstruct the secret plus all random blocks have to be combined. Also the way of usage of the erasure code has to be selected to not be leaking information but that&#x27;s more of an issue of not picking a bad way of how to implement the basic concept here. Basically just a case of &quot;do follow the instructions to shamir&#x27;s secret sharing, don&#x27;t do something different just because it&#x27;s a popular way of implementing reed-Solomon&quot;.<p>Yes, you can just GF(256), but if you&#x27;re worried I&#x27;d also just use a prime field instead.
  • sreekanth8509 hours ago
    ente means mine in Malayalam language. it&#x27;s said to be one of the toughest Indian language to learn. FYI.
    • alfirous8 hours ago
      Interesting, in Indonesia Ente means you. Derived from Arabic word Anta.<p>Fascinating how sometimes in different languages one word can have opposite meaning and the other times one word can have similar meaning.
      • thisislife21 hour ago
        Maybe it&#x27;s the pronunciation - <i>ente</i> means &quot;mine&quot; and <i>ante</i> means &quot;yours&quot; (in Malayalam) which is what perhaps you may be referring to? (Former South Indian kingdoms and South East Asia have historical cultural ties due to trade and conquest, and thus they share some common words, which I assume is, largely borrowed from Tamil and Malayalam).
      • aabdelhafez4 hours ago
        Ente also means &quot;duck&quot; in German.
  • DesiLurker5 hours ago
    SSS works pretty well. IIRC somebody in bitcoin community started using this for storing private keys using 3&#x2F;5 schema. they basically divide the secret keys into 5 parts out of which you only need 3 to recover original private key. IDK if there are any hardware wallets that actually support it yet though.
    • jan_k_3 minutes ago
      Trezor supports it.
  • calvinmorrison11 hours ago
    something tangentially i am interested in is computing following the &#x27;two person rule&#x27; for things like sudo. Yes I am logged into server X at terinal Y, and so is my co-worker and we both sign off on running command X
    • coryrc9 hours ago
      Had something like this at Google. There&#x27;s a service running as root (or equivalent) which receives your desired command to run, and it has to get authorization from another user for the specific command to run, then runs it. That makes sense at Google, because those are production machines and have access to LDAP and who is allowed to run a command on a machine is defined by an LDAP group and you would need two of them (or more?) and there&#x27;s already existing management website this can be shoe-horned into.<p>Your environment is unlikely to have all of that already, so you&#x27;ll need to figure out equivalents for all those. But I think you&#x27;re going to need a local service running as root and it&#x27;s going to need to be able to tell the difference between distinct human users, if you want secure. Just typos is way easier.
    • ahazred8ta6 hours ago
      There&#x27;s a related 2-man sudo login system here, not sure how finegrained it is.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;Argonne-National-Laboratory&#x2F;Pam-2man-Auth" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Argonne-National-Laboratory&#x2F;Pam-2man-Auth</a>
    • jerry197910 hours ago
      That sounds like you might want to look into digital signatures.
  • cryptoz9 hours ago
    See also a story about an implementation from Max Levchin: <a href="https:&#x2F;&#x2F;max.levch.in&#x2F;post&#x2F;724289457144070144&#x2F;shamir-secret-sharing-its-3am-paul-the-head-of" rel="nofollow">https:&#x2F;&#x2F;max.levch.in&#x2F;post&#x2F;724289457144070144&#x2F;shamir-secret-s...</a>
  • han114 hours ago
    [flagged]