@northerner The creator of the file would need to sign it somehow with their own private key first, no?
They would then provide the paired public key for public download, which you could use for verification.
If the creator encrypts something with their private key, when you decrypt it with the public key, you know that the message came from the owner because only the owner has private key.
If you encrypt something with public key, then only the owner of the private key can read it
Isn't that the way PGP works, you need to sign a key (with your own) to trust it. So you do need your own key pair before you can use anyone else's key?
I just tried deleting my own key and now when I try to verify a file with the authors key, I get the error message 'The used key is not certified by you or any trusted person.'
@northerner SSL (the encryption technology used by HTTPS and SFTP) ensures that the data cannot be viewed or modified while it is traveling from the server to your computer.
So, you can be safe in knowing that the file wasn't modified in transit, but if the server itself was hosting a comprised file, then SSL will not protect you from that
SSL uses public key encryption to safely transmit a one-way encryption key to your computer. That key is then used by your computer and the server to encrypt all communication.
@Michael so then where do people usually get the public key from? If the server hosting the file was compromised then it would seem easy to replace the public key?
I get that ideally the key fingerprint is given to the person over the phone or something, but I'm wondering about public websites like KeePass
Your browser automatically retrieves it during the connection process. It also checks to see if the public key validates against a certificate authority, and if it doesn't, it shows you a warning
You can see which certificate authority the site uses by clicking the Lock icon in the address bar.
If KeePass's web server was compromised then the attackers could post their own public key on the website and then regenerate the signatures using their own private key.
Not sure what the point of posting those signatures is tbh
The hashes ensure that the file wasn't corrupted during download
@northerner you do need to be careful to check the files were signed by Mr Dev Eloper and not Ms Hacker McBlackhat
so if the website hosting the <whatever> (software, intel, grandma's famous cookie recipe) is compromised, Ms McBlackhat can replace the <whatever> with her version of compromised software/intel/recipe
but she would have to replace the verification / signing info too
unless they also somehow get hold of the receiving person's mail account or manage to confuse you into using a different address, that only gets that person to receive a message they can't decrypt
I guess getting the public key from another server than the one hosting the download helps confirm the authenticity - it's less that two servers on separate networks are compromised.
But that's not what's happening with websites like KeePass's