# Efficiently formatting data so that each byte is critical

I'm experimenting with implementing a Fair Exchange Protocol that assumes there is a trusted third party to provide a hash-checksum of the two files for each missing byte, (so that the exchange can happen byte for byte towards the end of the files) as described here: Two mutually untrusted parties want to exchange data: how to ensure each one gets the data it needs?

What are the known practical algorithms to transform data to and from a 'byte-critical' format, where each byte(or bit) is needed to recover the data?

The responder mentioned erasure coding, but the wiki on that is pretty theory heavy and broad, was hoping for more direction. E.g. what coding would be useful for this application, and what are the memory/speed/security tradeoffs for different coding algorithms?

• The term for this is all-or-nothing transform. – yyyyyyy May 13 '17 at 20:09
• If only one byte in unknown, then there are only 256 remaining possibilities for the file. $\hspace{.93 in}$ – user991 May 13 '17 at 22:24