3 ms·
Interesting. Feels like you could accomplish the same effect with regular encryption though. Base64 encode the key, pad it with random data that matches the si
by tyingq 6y ago
Interesting. Feels like you could accomplish the same effect with regular encryption though.
Base64 encode the key, pad it with random data that matches the size of splitting into N-1 parts. Then split the encrypted file into N-1 b64 encoded parts. For lowish values of 'N', you could then just decrypt with each "key" until something readable emerges. The key size, algo, etc, could be prepended to each part in plaintext.
Or, if you want a variation where no parts are optional, a piece of the key in every split part, with a sufficiently long key.
- ur-whale 6y agoDoes your scheme support M-of-N recovery?
- deleted 6y ago[deleted]
- tyingq 6y agoNo, that's a good point. I was misled by some of the comments that assumed the posted scheme didn't either. However, I'm assuming "all parts present" is one of many desired use cases.
- nbadg 6y agoYou're looking for secret sharing algorithms, which is what this is using behind the hood. The classic (used in OP) is Shamir's secret sharing algorithm [1]. The general gist of it, simplified into the 2-of-N case, is: 1. the encryption key is the y-intercept of a line 2. each shared key ("horcrux" in the OP terminology) is a point along the line 3. more keys are simply more points on the line Once you have any two keys, you can fully define the line and recover the Y intercept. This gives you really strong guarantees because each point on its own reveals nothing about the y-intercept; without satisfying the M-of-N threshold, the value could still be anything. Generalizing this to the M-of-N case simply involves increasing the order of the curve (ie line -> parabola -> ...) [1] https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing