security - How do file hashes guarantee files haven't been altered? -


when downloading files trusted sites, provide hashes files can use authenticate file downloaded same 1 published (or if i'm wrong in this, please correct me!)

my question is: if hacker capable of modifying file on site, couldn't alter page on site published hash values reflect new "modified" values? if so, added security provide? if not, why not? or ... missing obvious how works?

the key attack vector you're protecting against:

  1. someone breaching main server

    if can in main server, can rewrite hashes appear valid (so no go).

    so hashes provide no protection against breaches of main server.

  2. someone breaching mirror server

    assuming hashes on main server, can add layer of defense against breaching mirror, can detect modifications.

  3. someone mitm in connection

    if can mitm connection, can modify both file , hash.

    so won't protect there @ all.

  4. a bit error in tcp connection

    this prime benefit of hashing files. in past, when error checking wasn't today, you'd download 100mb file, , there'd random bit errors in it. md5sum let detect errors , re-download file.

that's hash for. integrity checking downloaded on server.

if want security, need signature trusted private key (gpg). hashing nothing security in vast majority of cases.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -