How exactly does hashing work?
I know the command via the terminal, but where can I find the hash on the Github to verify that it match ?
You are dependent on the developer releasing the hash that they themselves have generated from the source code they have. You then calculate the hash from the code you have downloaded and check that it matches the hash provided by the developer. If the developer has not provided a hash, then you have nothing to check against so you cannot use this method.
Why is this ideal? It takes more time and provides no further benefits, unless you want to study the source code.
Because by skipping this step you are trusting that the pre-compiled software you are downloading matches the code you are looking at on GitHub. There is no guarantee this is true.
You need to verify the checksum, do note this doesn't prove anything other than the checksum is the same. This could have been altered by a malicious attacker. How you do it, differs depending on the checksum. For sha256 via the terminal on Linux you can use:
sha256sum
However, you should also verify via verifying their signature via gpg. Basically, you find their public signing key, import it into your keyring, and then you can try to verify the file. If it matches, it'll tell you that's a good signature. I'd recommend looking at the documentation of gpg.
Unfortunately, not every hardware wallet or software provide this. However, that probably gives you a reason to avoid them in the first place
Here's Trezor's documentation for their desktop application:
https://trezor.io/learn/a/download-verify-trezor-suite-appHowever, for any signatures being verified via gpg you'll be using:
gpg --import
And
gpg --verify
The fingerprint is only as good as the computer you are verifying it on. If your computer could've been compromised, then you can't verify that it's real. Also, you should probably look at deploying a web of trust, and finding the fingerprint on websites other than the main Trezor site. Since, if the Trezor site was compromised when you got the fingerprint from there, you could be tricked into thinking it's genuine.
If you're really serious about your security, verifying on two different computers could help with the concern that one of the machines is compromised. Verifying on a offline computer can also be a decent way.
As long as you can be sure that you've got the right signing key, and your machine isn't feeding you the wrong information via being compromised. You should be alright, to go ahead, and install the software. People's threat levels will differ. You can go really deep into verifying, establishing a web of trust, and mitigating various attacks.
For most people, importing, and verifying is enough.
The rule of thumb with software authenticity is: you should verify signatures whose public keys have been published on multiple places. There's absolutely no difference between using a non-verified software downloaded from Github, and a verified software whose binaries and public key(s) were published together. If Github is compromised, then public keys can also be compromised.
Thank you for your helpful replies.
Best regards
How can I check if a Firmeware from a HWW or a .exe files from a Desktop Wallet matches the code on GitHub ?
In short, there is no way.
if you have a source code and have a binary file, (as far as i understand) then there is no way to ensure the code and binary are matched, unless you compile it yourself.
This is how I understood it:
Always check PGP, so you can be sure that the file that was downloaded also comes from the provider.
If you trust the provider you can compare the file that was downloaded with the hash to make sure the code hasn't been changed.
If the hash is not provided by the provider, then this method is not applicable.
If the provider does not provide the hash or you do not trust the provider
Then there is only one method, compile it yourself