Ever seen “sign your commits with GPG” or “send me your public key”… and just nodded like you understood? ![]()
Yeah, same.
I went down the rabbit hole recently and tried to break it down in plain English — no crypto PhD required.
So… what is a GPG key (really)?
Super simple version:
-
GPG = tool for encryption + signing
-
It helps you:
-
Encrypt stuff → only the intended person can read it -
Sign stuff → prove it actually came from you
-
And every GPG setup has 2 parts:
-
Public key → you share this with people -
Private key → you guard this with your life (seriously, never share it)
Think:
Public key = your email address
Private key = your email password
Where you’ll actually see this in real life
This isn’t just theory — you’ll run into GPG in:
-
Git commit signing (GitHub “Verified” badge) -
Encrypting emails -
Signing packages/software downloads -
Securing sensitive files (API keys, backups, etc.)
First step: Check if you even have GPG installed
Quick check:
On Mac/Linux:
gpg --version
On Windows (CMD/PowerShell):
gpg --version
If that fails, try:
gpg2 --version
If you see version info → you’re good
If not → you’ll need to install GnuPG
How to generate a GPG key (the easy way)
Run this in your terminal:
gpg --full-generate-key
Then just follow the prompts:
-
Key type: RSA and RSA -
Key size: 4096 bits -
Expiry: ~1 year (you can renew later) -
Name + Email: use your GitHub/email identity -
Passphrase: make it strong (don’t be lazy here)
Once done, you’ll get a key fingerprint / ID — that’s your identifier.
Sharing your public key
You’ll need this for GitHub or sending encrypted messages.
Export it like:
gpg --armor --export your@email.com
Then:
-
Paste it into GitHub
-
Share with friends/teammates
-
Upload to a key server if needed
Mistakes that can mess you up
Learn from my paranoia:
-
Sharing your private key -
Weak passphrases (“password123”… c’mon
) -
Not backing up your key -
No revocation plan if it gets compromised
Basic security habits (that actually matter)
-
Treat your private key like a password vault -
Use a strong passphrase (long > complex) -
Backup your key securely (USB / password manager)
And this one is underrated:
Generate a revocation certificate right away
gpg --gen-revoke your@email.com
``
If things go wrong, this is your “kill switch.”
Fun (but nerdy) way to practice
Try this with a friend:
-
Exchange public keys
-
Encrypt something random (like an UNO move
) -
Send it and decrypt
Congrats, you are now playing Encrypted UNO™
Question for the community
-
Do you actually use GPG regularly, or just for GitHub commits?
-
Any horror stories of lost keys or broken setups?
-
Is it worth the effort for beginners, or overkill?
Would love to hear how you all approach this — I feel like GPG is one of those “everyone says use it, but few explain it well” tools.