<p>GnuPG is telling you that the signature corresponds to that public key (your file has a valid signature and wasn't tampered with in transit), but that it doesn't know if that public key is trustworthy.</p>

<p>If you trust your friendly neighborhood CA, then do the following:</p>

<pre><code>gpg --lsign-key 01EA5486DE18A882D4C2684590C8019E36C2E964
</code></pre>

<p>then enter your private key password to locally certify the key.</p>

<p>If you don't trust the CA (<a href="https://sci-hub.tw/10.1109/UEMCON.2017.8249081" rel="nofollow noreferrer">good on you for being suspicious</a>), ask someone you know who you do trust for the key fingerprint. If that key fingerprint matches what you imported, then you can run that command. If it doesn't, then something is up.</p>

CC BY-SA 4.0
2020-06-14T22:09:23.227Z
The command tells GnuPG that "The Bitcoin developer's signing key is trustworthy, reflect that fact the next time a signature is verified". The file you downloaded has already been signed by the website using TLS (so it's verified), but the PGP signature is just extra protection. The issue is that you have to trust that the key they listed is actually their key and not some impostor. You are right in your last sentence of the question: If bitcoin.org is hacked, the attacker can tamper with the key. This is why you should ask someone you trust for the fingerprint, for extra protection.
Expectator
CC BY-SA 4.0
2020-06-14T22:39:55.633Z
Right, but wasn't that the exact purpose of PGP keys? Being able to verify even if the website is compromised, otherwise this works just like verifying by the hash of the file, which an attacker can easily change if managed to get access to hosting of the website.
Ashfame
CC BY-SA 4.0
2020-06-14T23:54:30.217Z
The purpose of PGP is that it allows you to verify files out-of-band, but you still have to trust the key. A PGP key is identical to an X.509 certificate in nearly every way except the trust model. Unless you ask someone you trust either in person or using already trusted keys, there is no way of telling whether or not the key is trustworthy. You can build this trust by joining a Web of Trust, which requires events like keysigning parties. Unless you're extremely paranoid about the safety of the binary you downloaded, it's probably safe. PGP doesn't add extra safety unless you join a WoT.
Expectator
CC BY-SA 4.0
2020-06-15T07:09:33.577Z
Makes sense, thanks so much for explaining! Could you confirm `gpg --verify SHA256SUMS.asc` was sufficient to verify the SHA256hash of the file listed in it `0f1ea61a9aa9aba383a43bcdb5755b072cfff016b9c6bb0afa772a8685bcf7b0  bitcoin-0.20.0-win64-setup.exe` is accurate without me having to specify the file itself that I am trying to verify? I fear it could have just validated the signature and not the hash of the file by hashing the concerned file by locating it.
Ashfame
CC BY-SA 4.0
2020-06-15T14:50:18.033Z
If you verify the file with the list of hashes, that means that the hashes are trustworthy, not the file itself. You have to do another step. If the files you downloaded hashes to one of these already verified hashes, then the file is also valid. Run `sha256sum bitcoin-0.20.0-win64-setup.exe` and see if the hash matches. If that doesn't work, use `CertUtil -hashfile bitcoin-0.20.0-win64-setup.exe sha256`. The reason why one would elect to sign a list of hashes is for convenience; only one signature file needs to be made, not one for every file.
Expectator
CC BY-SA 4.0
2020-06-15T15:41:04.087Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/109395/discussion-between-expectator-and-ashfame).
Expectator
CC BY-SA 4.0
2020-06-14T21:34:11.223Z
Without understanding what did I achieve with my steps and what does your instructions aim to cover beyond that, its hard to get a grasp on it. Could you elaborate your answer? Perhaps start with to what degree the downloaded file can be considered as verified.
Ashfame
CC BY-SA 4.0
2020-06-14T20:35:21.550Z
2020-06-14T20:35:21.550Z
Expectator
<p>I downloaded the Bitcoin Core v0.20.0 from <a href="https://bitcoin.org/en/download" rel="nofollow noreferrer">https://bitcoin.org/en/download</a></p>

<p>To verify, I first imported the signing key at <a href="https://bitcoin.org/laanwj-releases.asc" rel="nofollow noreferrer">https://bitcoin.org/laanwj-releases.asc</a> and then ran command:</p>

<p><code>gpg --import laanwj-releases.asc</code></p>

<p>Then I downloaded the release signatures from <a href="https://bitcoin.org/bin/bitcoin-core-0.20.0/SHA256SUMS.asc" rel="nofollow noreferrer">https://bitcoin.org/bin/bitcoin-core-0.20.0/SHA256SUMS.asc</a> and to verify I ran command:</p>

<p><code>gpg --verify SHA256SUMS.asc</code></p>

<p>Output was:</p>

<pre><code>gpg:                using RSA key 90C8019E36C2E964
gpg: Good signature from "Wladimir J. van der Laan (Bitcoin Core binary release signing key) &lt;laanwj@gmail.com&gt;" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 01EA 5486 DE18 A882 D4C2  6845 90C8 019E 36C2 E964
</code></pre>

<p>Now, it says "Good signature" but the next two lines are <code>WARNING:  This key is not certified with a trusted signature! There is no indication that the signature belongs to the owner.</code></p>

<p>What did I accomplish then, till this point?</p>

<p>I also tried running <code>gpg --verify SHA256SUMS.asc bitcoin-0.20.0-win64-setup.exe</code> but got <code>gpg: not a detached signature</code> as the output.</p>

<p>Not sure if I was able to verify it correctly or not. I was stupidly quick enough to actually run the installer after noticing "Good signature" in output and matching the Primary key fingerprint on the webpage and it matched. Please explain what's going on here.</p>

<p>Also how does this signing even verify the integrity of the downloaded file when the malicious actor can also modify the file at <a href="https://bitcoin.org/laanwj-releases.asc" rel="nofollow noreferrer">https://bitcoin.org/laanwj-releases.asc</a> ?</p>

<p>Thank you!</p>

<bitcoin-core><pgp>
Verifying Bitcoin Core Integrity using PGP
Ashfame
# Verifying Bitcoin Core Integrity using PGP

(Asked by: username_0 on 2020-06-14)

I downloaded the Bitcoin Core v0.20.0 from <https://bitcoin.org/en/download>

To verify, I first imported the signing key at <https://bitcoin.org/laanwj-releases.asc> and then ran command:

`gpg --import laanwj-releases.asc`

Then I downloaded the release signatures from <https://bitcoin.org/bin/bitcoin-core-0.20.0/SHA256SUMS.asc> and to verify I ran command:

`gpg --verify SHA256SUMS.asc`

Output was:

```
gpg:                using RSA key 90C8019E36C2E964
gpg: Good signature from "Wladimir J. van der Laan (Bitcoin Core binary release signing key) <laanwj@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 01EA 5486 DE18 A882 D4C2  6845 90C8 019E 36C2 E964

```

Now, it says "Good signature" but the next two lines are `WARNING: This key is not certified with a trusted signature! There is no indication that the signature belongs to the owner.`

What did I accomplish then, till this point?

I also tried running `gpg --verify SHA256SUMS.asc bitcoin-0.20.0-win64-setup.exe` but got `gpg: not a detached signature` as the output.

Not sure if I was able to verify it correctly or not. I was stupidly quick enough to actually run the installer after noticing "Good signature" in output and matching the Primary key fingerprint on the webpage and it matched. Please explain what's going on here.

Also how does this signing even verify the integrity of the downloaded file when the malicious actor can also modify the file at <https://bitcoin.org/laanwj-releases.asc> ?

Thank you!

**Tags:** bitcoin-core, pgp


---

## 1 answers

### Answer by username_1 on 2020-06-14. Score: 0 | Accepted answer

GnuPG is telling you that the signature corresponds to that public key (your file has a valid signature and wasn't tampered with in transit), but that it doesn't know if that public key is trustworthy.

If you trust your friendly neighborhood CA, then do the following:

```
gpg --lsign-key 01EA5486DE18A882D4C2684590C8019E36C2E964

```

then enter your private key password to locally certify the key.

If you don't trust the CA ([good on you for being suspicious](https://sci-hub.tw/10.1109/UEMCON.2017.8249081)), ask someone you know who you do trust for the key fingerprint. If that key fingerprint matches what you imported, then you can run that command. If it doesn't, then something is up.

> **Comments:**
> **username_0**: Without understanding what did I achieve with my steps and what does your instructions aim to cover beyond that, its hard to get a grasp on it. Could you elaborate your answer? Perhaps start with to what degree the downloaded file can be considered as verified.  
> **username_1**: The command tells GnuPG that "The Bitcoin developer's signing key is trustworthy, reflect that fact the next time a signature is verified". The file you downloaded has already been signed by the website using TLS (so it's verified), but the PGP signature is just extra protection. The issue is that you have to trust that the key they listed is actually their key and not some impostor. You are right in your last sentence of the question: If bitcoin.org is hacked, the attacker can tamper with the key. This is why you should ask someone you trust for the fingerprint, for extra protection.  
> **username_0**: Right, but wasn't that the exact purpose of PGP keys? Being able to verify even if the website is compromised, otherwise this works just like verifying by the hash of the file, which an attacker can easily change if managed to get access to hosting of the website.  
> **username_1**: The purpose of PGP is that it allows you to verify files out-of-band, but you still have to trust the key. A PGP key is identical to an X.509 certificate in nearly every way except the trust model. Unless you ask someone you trust either in person or using already trusted keys, there is no way of telling whether or not the key is trustworthy. You can build this trust by joining a Web of Trust, which requires events like keysigning parties. Unless you're extremely paranoid about the safety of the binary you downloaded, it's probably safe. PGP doesn't add extra safety unless you join a WoT.  
> **username_0**: Makes sense, thanks so much for explaining! Could you confirm `gpg --verify SHA256SUMS.asc` was sufficient to verify the SHA256hash of the file listed in it `0f1ea61a9aa9aba383a43bcdb5755b072cfff016b9c6bb0afa772a8685bcf7b0  bitcoin-0.20.0-win64-setup.exe` is accurate without me having to specify the file itself that I am trying to verify? I fear it could have just validated the signature and not the hash of the file by hashing the concerned file by locating it.  
> **username_1**: If you verify the file with the list of hashes, that means that the hashes are trustworthy, not the file itself. You have to do another step. If the files you downloaded hashes to one of these already verified hashes, then the file is also valid. Run `sha256sum bitcoin-0.20.0-win64-setup.exe` and see if the hash matches. If that doesn't work, use `CertUtil -hashfile bitcoin-0.20.0-win64-setup.exe sha256`. The reason why one would elect to sign a list of hashes is for convenience; only one signature file needs to be made, not one for every file.  
> **username_1**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/109395/discussion-between-username_1-and-username_0).  

---

