<div dir="auto">You have basically described how the ZFS filesystem works for error detection and correction. <div dir="auto">It builds a Merkel hash tree of the per block hashes, stored in block pointers containing metadata (compression, encryption, hash algorithm ids, transaction birth id and information about the (upto) 3 copies of the block).</div><div dir="auto">In addition to RAID it also stores copies (always a minimum 2 copies of metadata).</div><div dir="auto">Block sizes are variable with 512 as the smallest and 1MB as the largest.</div><div dir="auto">The hashes are also able to be used for inline deduplication.</div><div dir="auto">When you have multiple copies you can not only detect but correct corruption by reading from an alternative copy and then issuing a repairing write.</div><div dir="auto">ZFS is also copy on write, so it never overwrites live data.</div><div dir="auto"><br></div><div dir="auto">When I added encryption to ZFS (in Solaris) I used AES in CCM or GCM. The IV and tag are stored in the blockpointer. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Darren J Moffat</div></div>