How to Share Your Public Key and Verify Fingerprints
What Is Safe to Share vs. What Must Stay Secret
Once you generate a PGP key online, you will have two files: a public key and a private key. Your public key and its fingerprint are meant to be shared openly—anyone who wants to send you an encrypted message or verify your digital signature needs your public key.
Your private key and passphrase, by contrast, must never be shared with anyone, posted online, or uploaded to a keyserver.
Practical Ways to Share Your Public Key
There are several reliable ways to distribute your public key:
- Direct attachment or website: Attach your
publicKey.txtfile to an email, or host it at a predictable URL on your personal website (such asyourdomain.com/pgp.txt). - Verifying keyservers: Services like
keys.openpgp.orgsend a confirmation link to your email address before publishing your identity, keeping the directory cleaner than legacy SKS keyservers (which suffered from poisoned keys and unsigned spam). - Web Key Directory (WKD): Domain owners can host keys under
/.well-known/openpgpkey/so compatible email clients fetch them automatically. - QR codes and business cards: Printing your fingerprint on a physical card or encoding it in a QR code makes in-person verification easy.
Why Fingerprint Verification Prevents Impersonation
Imagine Alice wants to send a confidential message to Bob. If an attacker intercepts Alice's search for Bob's key and substitutes a fake public key carrying Bob's name and email address, Alice's software will happily encrypt the message to the attacker's key.
To prevent this man-in-the-middle attack, Alice must verify Bob's key fingerprint through a separate, trusted channel—a process called out-of-band verification.
What a Fingerprint Is (v4 vs. v6) and How to Check It
A PGP fingerprint is a unique hexadecimal string derived from a hash of the public key. In OpenPGP v4 (the format OnlinePGP.com generates), fingerprints are 40 hexadecimal characters (SHA-1). In OpenPGP v6 (RFC 9580), fingerprints are 64 hexadecimal characters (SHA-256).
Note that OnlinePGP.com does not currently display key fingerprints in its web interface. To inspect the fingerprint of a key you generated or received, import the armored public key into GnuPG (gpg --import publicKey.txt) and run gpg --fingerprint, or import it into Thunderbird's Key Manager.
Always Compare the Full Fingerprint, Not Short Key IDs
Never rely on 8-character short key IDs (32-bit IDs), which are easy to spoof through collision attacks. Always compare the full 40-character (or 64-character) fingerprint character by character.
Good out-of-band channels include reading the fingerprint aloud on a voice or video call, comparing it in person, or sending it over an already-verified Signal chat. Trust on First Use (TOFU)—accepting a key the first time you see it without verification—is a weaker fallback when stakes are low, not a substitute for real verification. Read Common PGP Mistakes and What Is PGP? for more.
Frequently Asked Questions
Is it safe to post my PGP public key online?
Yes. Your public key is designed to be shared openly so others can encrypt messages to you. Just make sure you never post your private key.
What is a PGP fingerprint?
A fingerprint is a cryptographic hash of your public key—40 hex characters in OpenPGP v4 (SHA-1) or 64 hex characters in OpenPGP v6 (SHA-256)—used to verify its authenticity.
Why do I need to verify a fingerprint?
Without fingerprint verification, an attacker could trick you into encrypting messages with their fake public key instead of your contact's real key.
What if two fingerprints do not match?
Stop immediately and do not use the key. A mismatch means you either have an old key or someone is attempting to impersonate your contact.
Try It Now with OnlinePGP.com
Put this guide into practice right away. Generate a PGP key pair, encrypt a message, or verify a signature 100% locally in your browser.
Open the Online PGP Tool