jesseduffield / horcrux

Split your file into encrypted fragments so that you don't need to remember a passcode
MIT License
4.53k stars 116 forks source link

Option for XOR implementation #5

Open mcandre opened 4 years ago

mcandre commented 4 years ago

For users who want to require exactly N of N keys, XOR would be the safest, most performant, most reliable option.

jesseduffield commented 4 years ago

I don't have a particularly strong background in encryption. Are you referring to the encryption step? Or the step where we write to the horcruxes.

For context, currently when we require N of N horcruxes, I'm writing through a demultiplexer to give the first 100 characters of the encrypted content to the first horcrux, the second 100 characters to the second horcrux, and so on.

AyrA commented 3 years ago

I don't have a particularly strong background in encryption. Are you referring to the encryption step? Or the step where we write to the horcruxes.

XOR encryption for "N out of N" is actually quite simple. Instead of using SSS to generate N keys, you generate N random keys and XOR them all together. The result is your AES key.