y'all are not understanding the underlying principle: these things work holographically. Dumbledore even said that copying the soul fades it, when Harry was inquiring and specifically pondered the maximum number of times the soul could be copied. †
Horcrux: Split your file into encrypted fragments
121–130 of 153 posts
Re: Horcrux: Split your file into encrypted fragments
#122Earlier quoted context omitted.
It's inaccurate though. The whole point of horcruxes in the book is that Voldemort can always resurrect himself if one of them remains. This tool is the opposite: you need multiple parts to reconstruct the file.
He could not resurrect himself. He needed someone in not-ghost form, to collect some special items and perform a magical ritual. Some of the special items were also one-time use iirc. Perhaps, this tool needs to additionally encrypt some of the pieces with the dna of one's father or whatever.
Re: Horcrux: Split your file into encrypted fragments
#123Earlier quoted context omitted.
It's inaccurate though. The whole point of horcruxes in the book is that Voldemort can always resurrect himself if one of them remains. This tool is the opposite: you need multiple parts to reconstruct the file.
Horcrux would be a cool name for a database backup service
Any wholesome leader who is also a HP fan would not appreciate the name tbh.
Re: Horcrux: Split your file into encrypted fragments
#124Clever name
Re: Horcrux: Split your file into encrypted fragments
#125There's a cool paper-based backup tool that also uses Shamir Secret Sharing to let you distribute a bunch of paper copies to your friends to restore a file optically: https://github.com/cyphar/paperback
Is this different or do they do the exact same thing? https://github.com/paritytech/banana_split
That being said, the underlying cryptography is quite old and there aren't too many new ways you can spin it -- the goal of paperback was to make it possible for paper backups to be done in a way that non-technical folks can understand the properties. How well it currently lives up to that goal is a different question, of course.
I mainly wrote paperback because the existing SSS systems I could find at the time were all either very primitive, had serious security issues (I found two or three serious cryptographic vulnerabilities in the handful of existing tools at the time -- and I'm not a cryptographer by any stretch of the imagination), or were not usable as a paper backups system. There are more around now and it's possible I wouldn't have bothered with paperback if they'd existed back then.
Re: Horcrux: Split your file into encrypted fragments
#126First, you process the input data with an all-or-nothing transform (AONT)[2]. Then you split it into Reed-Solomon shares. AONT is required due to Reed-Solomon being vulnerable to a distinguisher[3] and it will most likely leak information about its input.
[1] https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_cor...>
[2] https://en.wikipedia.org/wiki/All-or-nothing_transform>
[3] https://en.wikipedia.org/wiki/Distinguishing_attack>
Re: Horcrux: Split your file into encrypted fragments
#127According to the FAQ it uses a Shamir Secret Sharing Scheme to split an encryption key. But you can actually use a Reed-Solomon scheme[1] and have no encryption key to achieve this objective. First, you process the input data with an all-or-nothing transform (AONT)[2]. Then you split it into Reed-Solomon shares. AONT is required due to Reed-Solomon being vulnerable to a distinguisher[3] and it will most likely leak i…
Note that the encryption step is, strictly speaking, not necessary for Shamir either. But there are benefits to encrypting the secret and only using SSS for the key (I'm not sure if that's how Horcrux works, but that's how my fairly-similar tool Paperback[1] works).
Re: Horcrux: Split your file into encrypted fragments
#128According to the FAQ it uses a Shamir Secret Sharing Scheme to split an encryption key. But you can actually use a Reed-Solomon scheme[1] and have no encryption key to achieve this objective. First, you process the input data with an all-or-nothing transform (AONT)[2]. Then you split it into Reed-Solomon shares. AONT is required due to Reed-Solomon being vulnerable to a distinguisher[3] and it will most likely leak i…
Is that approach information-theoretically secure? Shamir Secret Sharing is, and the mathematics is very simple. Note that the encryption step is, strictly speaking, not necessary for Shamir either. But there are benefits to encrypting the secret and only using SSS for the key (I'm not sure if that's how Horcrux works, but that's how my fairly-similar tool Paperback[1] works). [1]: https://github.com/cyphar/paperback
No. But neither is SSS if an encryption key is involved - because the symmetric encryption step is not information-theoretically secure.
Using SSS directly on the input will be information-theoretically secure but also multiply the size of the input.
> and the mathematics is very simple.
The mathematics of SSS and Reed-Solomon are virtually identical.
Re: Horcrux: Split your file into encrypted fragments
#129Caution, this tool uses AES in OFB mode[0] to encrypt/decrypt the file, without any guarantee of the ciphertext integrity(no MAC). [0]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation...
That wiki went over my (fairly) technical head. Care to ELI5?
With OFB (and CTR, and any other unauthenticated cipher basically), no. Ciphers guarantee confidentiality, but nothing else. This means that the attacker can alter one of your encrypted backed-up files. It's not a hypothetical attack. For example your backed up /bin/ls file likely starts with something like (hexencoded):
7f454c4602010100000000000000000002003e000100 .ELF..............>...
Let's assume attacker wants to trick you into running "echo hacked" on your system. They may achieve this by altering your backed up /bin/ls such that it decrypts to something like this: 23212f62696e2f73680a6563686f206861636b65640a #!/bin/sh\necho hacked\n
And it's really easy! Stream ciphers work by XORing input plaintext with keystream: ciphertext = plaintext ^ generate_keystream(key)
plaintext = ciphertext ^ generate_keystream(key)
If you look closely at the equations, it's apparent that one can flip a byte in decrypted plaintext by flipping a byte in the ciphertext. To drive the point home, a small demonstration in Python (I'll use CTR instead of OFB but it's the same): >>> from Crypto.Cipher import AES
>>> def xor(a, b): return bytes([ac ^ bc for ac, bc in zip(a, b)])
>>> aes_enc = AES.new(b"mysupersecretkey", AES.MODE_CTR)
>>> plaintext = open("/bin/ls", "rb").read(32)
>>> ciphertext = aes_enc.encrypt(plaintext)
>>> known_plaintext = bytes.fromhex("7f454c4602010100000000000000000002003e000100")
>>> wanted_plaintext =bytes.fromhex("23212f62696e2f73680a6563686f206861636b65640a")
>>> flip = xor(known_plaintext, wanted_plaintext)
>>> flipped_ciphertext = xor(flip, ciphertext)
>>> aes_dec = AES.new(b"mysupersecretkey", AES.MODE_CTR, nonce=aes_enc.nonce)
>>> aes_dec.decrypt(flipped_ciphertext)
b'#!/bin/sh\necho hacked\n\\d\xc3\xd9\*o.sh\n'
In this example attacker can change the first 22 bytes of file to arbitrary payload by abusing the predictable header of the ELF file. No knowledge of the key is necessary.Re: Horcrux: Split your file into encrypted fragments
#130I have always wanted a cloud storage client which spread my files in chunks out among OneDrive, GDrive, etc. Essentially cloud raid to make it harder to put things back together.