Don Quixote de la Mancha wrote:
The Chicken and Egg Problem for checksums was solved for the IP
header
checksum, and the TCP payload checksum back during the 1970s.
That's Fletcher's checksum, which is not robust. It's possible to
put a 32 bit checksum into a program which it can use to check
itself. For not too big a program (1MB), that's robust enough.
It's essentially a checksum modulo -1.
When calculating the checksum, set the checksum field itself to
zero.
When verifying the checksum, skip over the value that is actually
present. Perform the calculation as if it was actually set to zero.
CD and DVD images could do the same thing.
It would be enough to append a single 32-bit CRC just to ensure that
your download wasn't corrupted, or that you had a good burn, but if
That's not good enough for GB sized downloads, IMO.
you wanted to make sure that the Russian Mafia hadn't patched
your
kernel, you could add one entire 2048-byte sector to your image, and
fill it all up with one big cryptographic hash.
Again, that's done inside the file system. Having separate
good hashes on each file is much much better than one checksum
on the entire image, and it eliminates the problem of having
to put the checksum in from the outside, and problems of
figuring out how much to read, though that should be a solved
problem, I think. K3b can do it.
Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!