What is the difference? I found it quite hard to check for integrity using Gpg4win. Checking for hash was easy with Online MD5 & SHA1 Hash Generator For File. Is there any advantage to use Gpg4win? I often see that software developers leave their PGP and signing keys for verification and quite few leave a hash for that purpose. Why?


1 Answer 1


Yes, there is a lot of difference, although it depends on how the software is produced and published as well.

With a hash you can just check if the file - as downloaded - is correct. For instance if you retrieve a file through a mirror or torrent then you might get a different file than you asked for. Validating the hash on a controlled site by the owner can then assure you that the file is correct. Of course you'd want a different hash than MD5 and SHA-1 is not secure anymore either - SHA-256 is often used instead. However, if an attacker can replace that hash then you're still vulnerable; all it takes is to compromise the site hosting the hash; anybody can calculate a hash over any file after all.

If there is a signature over the file, and you can trust the public key of the developer, then you can just verify the signature. An attacker cannot create a valid signature even if the hosting site of the signature is compromised. In general the key is kept secure with the developer team rather than the persons available for the hosting of the signature.

That's not to say that signatures are a panacea. Establishing the trust of the public key can be tricky and the security of the signing key or signature generation service may not be up to par. For instance, Microsoft authenticode keys have been misused in the past.

  • $\begingroup$ But I still don't understand what advantage it has because they provide their public keys on their websites. So if an attacker can modify the hash (either through Man In The Middle or through hacking the website) then they can also modify the public key. Unless you are going to call the developer on the phone and check their public key's fingerprint I don't understand how signature can be more secure than hash when it comes to sharing files on websites. $\endgroup$
    – Pouria
    May 3, 2018 at 14:43
  • $\begingroup$ Public keys you only have to download once, so there is a difference with regards to time. Although if you publish a new key and signature on the site I would not be surprised if it would be accepted without question. But yes, a public key isn't worth anything without trust. $\endgroup$
    – Maarten Bodewes
    May 3, 2018 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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