8/9 I got two files, one is size 522190848 and the other is size
521648128. Both sha256 to the same number. (and sha1 too).
I don't think this is supposed to happen, right? (least not with
sha256).
\_ how are you checking?
\_ I burned one file to cd, so i mounted /cdrom and
df --block-size=1 /cdrom (=521648128)
then i re dl'ed the iso and checked the size: 522190848
both sha256's of iso and /dev/hdc yield the same.
I have done this type of check on other isos and they yield
the same sha[1,256] and size on both. Just this one is weird.
\_ I don't think df is giving you the number you want.
Try "wc -c /dev/hdc".
\_ hash collisions can (and rarely do) happen. You're deriving a
number consisting of some hundreds of bits from data with millions.
The idea behind the hashing algorithm is that it is hard to get
collisions on purpose, and rare with small changes i.e. bit error or
tampering.
\_ I don't think an SHA-256 collision has ever happened by accident.
If you have two different files, the probability that they have
the same SHA-256 hash by chance is 2^-256; that's less than the
chance that in the one second after you hit Enter to calculate
the hashes, your computer is obliterated by three separate
meteorites independently. It could happen, but it's not very
likely. |