4 ms·
I'm not terribly deep in this space. What is the conceptual difference of hash vs GPG sig?
by tomrod 4y ago
I'm not terribly deep in this space. What is the conceptual difference of hash vs GPG sig?
- atoav 4y agoA hash is the same when the values of the content are the same. But when you get a new (maliciously hacked) install script chances are that you won't have an old hash lying around to check whether the script changed. Any attacker who could swap the sceipt could also swap the hash, unless it is a different channel. With GPG the developer has a key pair (one private, one public). They can then sign all their scripts with their private key and publish the public one wherever. You can then take that public key and verify that the script has been indeed signed by the developers private key.
- thewataccount 4y agoAdmittedly this is likely the main reason GPG isn't more common place because of the complexity. This is the overview: Developer generates a private/public key they use for all of their projects. You import their public key once - you can verify this from their github, twitter, etc but that's optional. They can sign a file with their key. You can check this signature against their public key. This will guarantee the file was signed by using that key and is unmodified. If someone hijacks the website after this point and signs the new downloads with their own key - then you will be able to see it's invalid. If you manually verify the key then you'll know your initial download is valid - if you trust on first use then you at least know all future files signed from that developer with that cert are valid. They also are effectively a hash for file integrity. tl;dr - hashes tell you if a file is changed. Signatures tell you if the file is changed, and who the person that made the file is.
- Jarwain 4y agoHash essentially proves that the file you downloaded is the same as the file that was uploaded. It tells you nothing about Who uploaded the file. An attacker could make you download their own file, but then the hash of the file won't match what's published (unless the attacker changes the published hash). A GPG sig proves that the file was signed & uploaded by the author, which defacto doubles as proof that it's the same file. The idea here is that the author uploads their public key, signs the package with their private key, and now there's an association between the package and the author. An attacker would have to obtain the author's private key, or replace the public key with their own. Changing the public key, however, is a big red flag.
- bigiain 4y agoI don’t think that’s a real problem here though. I couldn’t care less if the Chinese government hosts an install script, if there’s no possibility they could have changed a single byte of the script. Assuming I have a trusted way of knowing the installer script hash (which is a big assumption), I don’t need authentication for the script download, I only need integrity checks.