Some websites publish sha256 to check authenticity of downloaded file.

I suppose this is to protect against man-in-the-middle attack - that my file was not altered during download.

What prevents man-in-the-middle from altering web traffic and fix hash code that I see to match malicious downloaded file ?

Those sites often do not provide SSL, so capturing and fixing HTTP traffic is easy, all it takes is to work with my ISP or some backbone router.

There are even sites that allow to calculate sha256 by uploading file over unsafe HTTP with no SSL - ridiculous isn't it ?

Not only I have to trust that this website does not work for government, I also have to trust my ISP by connecting without SSL.

  • 4
    This question appears to be off-topic because it is not about bitcoin or cryptocurrencies but about general security and verification. It would probably be more at home on another StackExchange sub-site.
    – dchapes
    Apr 11, 2014 at 10:15
  • I somewhat agree, but I planned to ask it together with this question: bitcoin.stackexchange.com/questions/24489/… and then decided to take them apart. Apr 12, 2014 at 3:15
  • Agree - though nice, this question pertains more to another S.E. site
    – Joe Pineda
    Apr 12, 2014 at 3:41
  • Which site ? I don't know how or do not have permission to move it. I guess somebody with higher rating could move it for me. Apr 13, 2014 at 2:06

1 Answer 1


Nothing. It is mostly only useful for checking data integrity, not detecting malicious modification (unless you know someone trustworthy that signed the hash). SSL has the same problems though, because public keys can be altered too of course.

There are multiple solutions to this problem, although none is perfect.

  • Trusting some central authority to decide who is trustworthy and who is not (i.e. Certificate authority). This approach has been shown multiple times to be dangerous, see DigiNotar for example.
  • Building a web-of-trust, the method PGP (and later GPG) implemented.
  • Circumventing the normal network with private lines and routing (the military approach), or wait for quantum encryption to become available.

Not the answer you're looking for? Browse other questions tagged or ask your own question.