Questions tagged [gpg]

gpg is the main command line tool of the GNU Privacy Guard (GnuPG), implementing the OpenPGP standard for public key cryptography. It allows encryption, (verification of) signatures and trust models like the web of trust. gpg (and its library gpgme) are the base of many FOSS crypto applications (like mail user agents). There is a standalone version (1.x) and one (2.x) requiring gpg-agent for secret key handling.

GNU implementation of OpenPGP, the cryptographic toolset : http://gnupg.org/

List of GUIs: https://www.gnupg.org/related_software/frontends.html

712 questions
323
votes
3 answers

How to import secret gpg key (copied from one machine to another)?

I'm trying to copy my gpg key from one machine to another. I do: gpg --export ${ID} > public.key gpg --export-secret-key ${ID} > private.key Move files to new machine, and then: gpg --import public.key gpg: nyckel [ID]: public key [Name, e-mail]…
user50849
  • 5,202
86
votes
7 answers

How are the GPG usage flags defined in the key details listing?

When I list the details of a key I get output like this: $ gpg --edit-key SOMEID pub [..] created: [..] expires: [..] usage:SC [..] sub [..] created: [..] expires: [..] usage: E Or even usage: SCA on another key (the master-key part). What does…
maxschlepzig
  • 57,532
46
votes
6 answers

gpg does not ask for password

I encrypted one file with gpg -c and closed the terminal. After a while, I tried to decrypt it with gpg and it decrypted it, without asking for a password. Is that normal? How to guarantee that gpg will ask for a password, even in my…
Pierre B
  • 2,213
45
votes
3 answers

How to renew an expired encryption subkey with gpg

I renewed my gpg key pair, but I am still receiving the following error from gpg. gpg: WARNING: Your encryption subkey expires soon. gpg: You may want to change its expiration date too. How can I renew the subkey?
cgl
  • 1,181
36
votes
4 answers

help understanding gpg --list--keys output

When I run gpg --list-keys I get the following output: /home/yax/.gnupg/pubring.kbx ---------------------------- pub rsa2048 2020-10-09 [SC] 4424C645C99A4C29E540C26AAD7DB850AD9CFFAB uid [ultimate] yaxley peaks…
36
votes
1 answer

I fail to fetch GPG keys over HKPS with "gpgkeys: HTTP fetch error 1: unsupported protocol" error

I'm trying to fetch some GPG keys over keys.gnupg.net and hkps.pool.sks-keyservers.net and both fails with: gpg: requesting key 1F41B907 from hkps server hkps.pool.sks-keyservers.net gpgkeys: HTTP fetch error 1: unsupported protocol I'm using…
Braiam
  • 35,991
33
votes
2 answers

Encrypt and sign with specific secret key

I have an OpenPGP smart card key (YubiKey NEO) as well as a local secret key installed in my GnuPG keyring. I'd like to encrypt and sign a file with my card's key, not the key in my keyring. How can I specify what key I'd like to sign with? If my…
Naftuli Kay
  • 39,676
32
votes
4 answers

GnuPG command to show key info from file

When I run gpg --with-fingerprints --with-colons keyfile.key, I get a machine parsable output on stdout containing the key fingerprint for the key inside the keyfile (which is exactly what I want), plus the following error on stderr: gpg: WARNING:…
rexroni
  • 1,508
27
votes
5 answers

How can I remove the passphrase from a gpg2 private key?

Yes, I know it is a step into a lesser secure system, but the current setting makes it reasonable (the key is not important, but the signing has to be automatized). Google results say this: List the keys with a gpg --list-keys Edit the key with a…
peterh
  • 9,731
25
votes
5 answers

gpg: error retrieving 'me@example.com' via WKD

I am trying to encrypt a file locally and I get an error. me@example.com is a placeholder for my email address, a public key exists for that in my keyring and also on key servers. My private key is located on a hardware key (Yubikey). I can decrypt…
mehdix
  • 695
22
votes
3 answers

Is there a way to GLOBALLY set the DEFAULT keyserver for gpg on Debian?

I am not asking for per-request of a key, I know how to do that, but I want a chosen alternative gpg keyserver to be defaulted to, when no specific keyserver is specified in a request then-on-out. Any ideas?
user74426
16
votes
2 answers

What is the armored option for in GnuPG?

when I export a gpg private or public key, and specify armored as a switch, I get plain text key, however, the gnupgp website seems to state that these keys are actually encrypted. What's the point in calling it armored if its just plain text? I…
John Smith
  • 161
  • 1
  • 1
  • 3
16
votes
7 answers

Encrypt multiple files at once

I'm writing a script which creates project archives and then creates 7z archives of them to make it easier on me to save specific versions and keep encrypted backups. After I've generated the archives and I get to the encryption phase, I'd like to…
Naftuli Kay
  • 39,676
14
votes
3 answers

How do I get the fingerprint of an ASCII-armored PGP secret key with gpg?

I have a file secret.asc containing an ASCII-armored (i.e., plain text and starts with -----BEGIN PGP PRIVATE KEY BLOCK-----) PGP/GPG secret/private key, and I would like to know its 40-character key fingerprint without importing it into my GPG…
jwodder
  • 448
14
votes
3 answers

GPG key server for key search?

1) How do I know which servers are used to search for keys with gpg gpg --search-key 2) How to add a server to the list of queried server?
user123456
  • 5,018
1
2 3 4 5 6 7 8