How to check gpg signature given only the fingerprint and key ID

digital-signaturegnupg

I am trying to check the integrity of my gmp-6.1.2.tar.lz download (see here). I am on CentOS 6.6 using gpg (GnuPG) 2.0.14.

The GMP website only lists

Key ID: 0x28C67298 
Key type: 2560 bit RSA 
Fingerprint: 343C 2FF0 FBEE 5EC2 EDBE F399 F359 9FF8 28C6 7298 

When I run (as suggested here):

$ gpg --verify gmp-6.1.2.tar.lz.sig gmp-6.1.2.tar.lz
gpg: Signature made Sun 18 Dec 2016 03:18:35 PM EST using RSA key ID 28C67298
gpg: Can't check signature: No public key

QUESTION

  1. How do I extract the fingerprint from gpg to compare with the GMP website?

  2. I don't know where or how to get the public key for gmp, is this fingerprint checking good enough? This does not seem to be very secure since I'm checking the signature of the file from the same website that I downloaded the file from.

Best Answer

I don't know where or how to get the public key for gmp, is this fingerprint checking good enough?

The key can usually be obtained from public keyservers, based on its ID or fingerprint.

gpg --recv-key '343C 2FF0 FBEE 5EC2 EDBE F399 F359 9FF8 28C6 7298'

Alternatively:

gpg --auto-key-retrieve --verify gmp-6.1.2.tar.lz.sig gmp-6.1.2.tar.lz

Comparing its fingerprint is enough to ensure you got the correct key.

This does not seem to be very secure since I'm checking the signature of the file from the same website that I downloaded the file from.

Indeed, it's not very secure. You should try to verify the fingerprint using other means, e.g. sometimes it's part of release announcements in mailing list archives; I sometimes use web.archive.org to make sure the website hasn't changed recently.

(The "traditional" PGP mechanism, web of trust, unfortunately is not very useful here.)

Verification can still be useful though:

  • The same key is used to sign many releases. Even if you don't know whose key it is, it might still be enough to know that it's the same key which has been legitimately signing releases for the past few years.

  • The actual download could be hosted on various mirror sites. If you trust the main project website, you can use this information to verify archives downloaded from anywhere.