What is the correct procedure to download the official bitcoin client, and validate it was signed by the developers, and not infected with any malware by a man in the middle?
To verify the signature on a release, obtain the key from the link above. Obtain the release announcement from the link above. Obtain the download from any source. Then point GPG at the release annoucement (or the signature block from it, including the BEGIN and END lines). GPG will ask what file you want to verify, pick any of the ones listed in the signature certificate. It will then tell you if the release is identical to the release Jeff Garzik signed.
Intructions for Linux:
You need to have the following files:
Download the file you want to check:
wget -c https://bitcoin.org/bin/bitcoin-core-0.13.2/bitcoin-0.13.2-x86_64-linux-gnu.tar.gz
Download the hash sums containing file:
wget -c https://bitcoin.org/bin/bitcoin-core-0.13.2/SHA256SUMS.asc
Download the release signing key:
wget -c https://bitcoin.org/laanwj-releases.asc
You check the file as follows:
The signing key needs to be imported:
gpg --import laanwj-releases.asc
Check the hash sum file signature:
gpg --verify-files SHA256SUMS.asc laanwj-releases.asc
It should say:
Good signature from "Wladimir J. van der Laan.
So now we know that the hash sum file is signed with the provided key we trust.
Finally, check the file of interest:
gpg --verify-files bitcoin-0.12.1-linux64.tar.gz SHA256SUMS.asc
It should say:
Good signature from "Wladimir J. van der Laan (Bitcoin Core binary release signing key) "
So now we know that the tarred file is signed with the provided key we trust.
Check that the hash sum matches:
sha256sum --ignore-missing -c SHA256SUMS.asc
It should say:
I would grab this script from bitcoin-core's repository, then comment out the line where it calls the
clean_up function at the end. Then when you call it, it not only downloads the binaries in /tmp/bitcoin/, it also verifies the hashes.
- Visit http://sourceforge.net/projects/bitcoin/files/Bitcoin/
- Pick the latest version folder.
- Download one of the SHA...SUMS files and examine it in your favorite text editor.
- Download the installation file you want to use.
- If you don't know how to get your computer to tell you the checksum of a file, you'll have to go figure that out. Compare the checksum with the one in the file. If they match, then you've determined one thing that is important: The file you downloaded is the same as the file used by whoever created that checksum.
Now you want to know if you can trust that person. He has an account at Sourceforge and he has made a file available to you and you now have that file, and what you proved in step 5 is that you got the same file he made available, as opposed to a fake from someone on the Internet between you and Sourceforge.
I just did this with version 0.7.1, and that person is Gavin Andresen. I have Kleopatra for Windows, so I looked up "Gavin Andresen" on the pgp.mit.edu certificate server, and found a certificate for him with "(CODE SIGNING KEY)" in the name. I imported it to Kleopatra and then verified that the checksum file I downloaded in step 3 was signed by the person who made that key (Anybody can make a key and pretend to be Gavin).
But let's be paranoid...
I could still have bad code because I might have downloaded an imposter's certificate, and had my connection hijacked for the download. So I Googled "Gavin Andresen certificate fingerprint" (without quotes) and found a page at https://bitcointalk.org/index.php?action=printpage;topic=69355.0 that displays the fingerprint of "Gavin"'s certificate, and it matches. With all this information, I assume I'm ok. If I didn't, I'd have to get the source and examine it, as Evil Spork explained.
Here is an easy walk through on how to authenticate bitcoin-qt on GNU/Linux systems (Like Trisquel, Fedora, Ubuntu, Debian, etc):
- Open a terminal
- Download the core developers PGP key (https://bitcoin.org/en/development)
- Import the core developers PGP key with GPG:
gpg --import gavinandresen.asc
From the https://bitcoin.org/en/download page click on the "Linux (tgz)" file to download.
From the bitcoin download page click on the "Verify release signatures" link to download the signature.
Authenticate the file release was compiled by the core developer:
gpg --verify SHA256SUMS.asc
The most important line to make sure you see is:
gpg: Good signature from "Gavin Andresen (CODE SIGNING KEY) "
A 2nd line you will see is:
gpg: WARNING: This key is not certified with a trusted signature!
This line means that you don't know if you can trust the signature that you imported. Short of meeting the core developer Gavin Andresen in person or at least getting his public key from somebody you trust who has met him you won't ever be able to truly trust the download. However you can at least be confident that all future releases are at least being compiled by the same person. If you don't see "Good signature" you know you have a problem.
While you are at it you may want to import the keys of other core developers just in case. It may be at some point another core developer signs. You'll have more confidence its from a trusted party than if you have to import the key at the time of the download.
Q: How can one download the bitcoin client securely?