this post was submitted on 11 Nov 2025
30 points (100.0% liked)

Linux

59531 readers
1412 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

Hey guys, I wanted to ask you how you manage your gpg keys? Having them in plaintext all the time on my hard drive feels unsecure.

I have my ssh keys in a password manager (KeePassXC) that only exposes them to the keyagend, when unlocked. Do you know if something like that exists for pgp too?

top 17 comments
sorted by: hot top controversial new old
[–] AstroLightz@lemmy.world 2 points 1 day ago

I mainly use Kleopatra with a dedicated passphrase for it.

[–] floquant@lemmy.dbzer0.com 2 points 1 day ago

If the private keys have a passphrase they're already encrypted. The fact that it's a text file doesn't mean it's a plaintext file. But for improved security, you could use a Yubikey or similar hardware token.

[–] SMillerNL@lemmy.world 6 points 2 days ago (1 children)
[–] splendid9583@kbin.earth 4 points 2 days ago (1 children)

This is very interesting information!

I'd like to note that it's likely that several recommendations used as examples have been superseded with information around https://www.privacyguides.org/en/real-time-communication/ and similar locations, since expressing "use WhatsApp" makes me suspicious (and "use Wire" does not make me more confident): https://www.makeuseof.com/why-i-dont-trust-whatsapp/ https://proton.me/blog/is-whatsapp-safe

[–] SMillerNL@lemmy.world 2 points 1 day ago (1 children)

The link I posted focuses on security, what you post focuses on privacy. Wire is a very secure protocol but WhatsApp being owned by Meta still makes it a privacy nightmare.

Signal is probably a better choice in that case.

[–] splendid9583@kbin.earth 1 points 19 hours ago

It seems that the people managing privacyguides.org believe that "Balancing security, privacy, and usability is one of the first and most difficult tasks you'll face on your privacy journey." https://www.privacyguides.org/en/basics/threat-modeling/

That does raise the question about whether we want to make information available for someone on a "privacy journey" or "security journey" or some other type of journey. https://blog.hubspot.com/marketing/target-audience I suspect that securityguides.org isn't being used like how privacyguides.org is right now.

[–] mark@social.cool110.xyz 4 points 2 days ago

@Zenlix A hardware solution is the best route, Yubikey and/or smartcard.

[–] med@sh.itjust.works 3 points 2 days ago* (last edited 2 days ago)

I'd agree that a hardware solution would be best. Something designed specifically to do it. I've been eyeing up the biometric yubikey for a while.

I do this for ssh keys, VPN certs and pgp keys. My solution is pretty budget, I generate the keys on a LUKS encrypted USB and run a script that loads them in to agents, and flushes them on sleep. The script unlocks and mounts the LUKS partition, adds the keys to agents, unmounts and locks the USB. The passwords I just remember for the unlock and load into memory, but they're ripe for stuffing in to keepass-xc - I need to look at the secret service api and incorporate that in to the script to fetch the unlock passwords directly from keepass.

I have symlinks in the default user directories to the USB's mount points, like ~/.ssh/id_ed25519 -> /run/media/<user>/<mount>/id_ed25519. By default, when you run ssh-agent, it tries to add keys in the default places.

The way it works for me is:

  • plug the USB in to the laptop after a restart or wake-up
  • run script
  • enter passwords for luks key, ssh-agent, gpg agent etc.
  • Unplug USB.

I keep break-glass spares in a locked cabinet in my house and office, both with different recovery keys

I do this because it's my historical solution, and I haven't evaluated the hardware options seriously yet.

[–] Flax_vert@feddit.uk 3 points 2 days ago

I store them in an app on my phone behind password protection

[–] hummingbird@lemmy.world 3 points 2 days ago (1 children)

You should not store your privates keys unencrypted. In fact by default your keys are stored password protected just as if you'd store them in keepass.

[–] Zenlix@lemmy.ml 3 points 2 days ago (1 children)

How secure is the password protection?

[–] Flax_vert@feddit.uk 3 points 2 days ago (1 children)

Depends on how strong your password is and the environment you are entering the password in

[–] hummingbird@lemmy.world 1 points 1 day ago

It differs between software vendors and versions. For example, if you're using a recent version of gnupg, your key is most likely stored using openpgp-s2k3-ocb-aes. Use that as a starting point to find more information on how good the protection is. I personally would rate it a fair bit lower compared to the key derivation methods used in keepass which focus more on brute force resistance.

[–] coolie4@lemmy.world 3 points 2 days ago (2 children)

Is also storing your gpg keys in KPXC unsuitable for your purposes?

[–] bruce965@lemmy.ml 2 points 2 days ago

I am not OP, but that would be the ideal solution for me. Unfortunately, KPXC does not support communication with the GPG agent and the team is not interested in adding this feature due to it being «[…] far more complicated than ssh-key management. There are already excellent tools for this, Kleopatra being the best».

[–] Zenlix@lemmy.ml 2 points 2 days ago

That would chsnge nothing, simce they would also be on the hard drive.

[–] MonkderVierte@lemmy.zip 2 points 2 days ago

Have them in a plain-text but encrypted with gpg?