A format that makes a file completely unreadable if any part of it gets corrupted.
Usage:
python ./brittle.py file.txt out.bin
python ./brittle.py file.bin out.txt --decode
- Get hash of entire file (call it hash A)
- XOR file using hash A
- Get hash of XOR'd file (call it hash B)
- XOR hash A using hash B (call it key)
- Put key at beginning of file
- Hash file excluding key (we get hash B)
- XOR key using hash B (we get hash A)
- XOR file excluding key with hash A
- File is good if its hash matches hash A