I am storing some multi-GB files on two hard drives. After several years in offline storage (unfortunately in far from ideal conditions), I often get some files with bit-rot (the two copies differ), and want to recover the file. The problem is, the files are so big, that within the same file, on some storage devices one bit gets rotten, whereas on another one a different bit gets bit-rotten, and so neither of the disks contains an uncorrupted file.
Therefore, instead of calculating the MD5 checksums of the entire files, I would like to calculate these checksums of each 1KB-chunk. With such a small chunk, there is a lot less chance that the same 1KB-chunk will get corrupted on both hard drives.
How can this be done? I am sure it shouldn't be hard, but I spent over an hour trying different ways, and keep failing.