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.

Filter by
Sorted by
Tagged with
46
votes
6answers
20k views

How can I find out what keys gpg-agent has cached? (like how ssh-add -l shows you cached ssh keys)

ssh-add -l shows you all ssh-keys that have been added with ssh-add ~/.ssh/id_yourkey. How do I do the analogous thing with gpg and gpg-agent, in other words, ask it to show a list of cached keys?
225
votes
3answers
282k views

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 ...
113
votes
2answers
47k views

How to renew an expired keypair with gpg

What is the best way to renew a gpg key pair when it got expired and what is the reason for the method? The key pair is already signed by many users and available on public servers. Should the new ...
86
votes
18answers
219k views

gpg asks for password even with --passphrase

I expect the following command to extract the gpg file without asking for password: gpg --passphrase 1234 file.gpg But it asks for the password. Why? This also have the same behavior: gpg --...
5
votes
1answer
22k views

Unable to verify the kernel signature “gpg: Can't check signature: public key not found”

In order to compile a new kernel on my Debian jessie, I am trying to verify the GPG key , following the instruction on the official website. I have download the the linux-3.18.35.tar.sign and linux-3....
70
votes
6answers
30k views

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: ...
21
votes
4answers
39k views

pass and gpg: No public key

I'm using the pass for quite a long time; but after exporting my key storage and gpg keys to another machine I see following output: $ gpg --list-key /home/shved/.gnupg/pubring.gpg -------------------...
16
votes
2answers
8k views

How can I automate gpg decryption which uses a passphrase while keeping it secret?

I am tasked with automating a gpg decryption using cron (or any Ubuntu Server compatible job scheduling tool). Since it has to be automated I used --passphrase but it ends up in the shell history so ...
4
votes
1answer
2k views

Encrypt files using gpg (and them symetric encrypting the key) - is it a normal thing to do in the *nix world?

I read a lot of articles about using gpg to encrypt email, but I would like to use it to encrypt some files - mainly a bunch of *.isos. I'm going to describe what I thought I would do, so you can ...
11
votes
2answers
29k views

Invalid signatures when running apt-get update

I am trying to run an update, I get a lot of "Hit"'s and "Ign"'s but in the end I get these errors, does anybody know what they mean and how I can fix them? W: GPG error: http://speglar.simnet.is ...
10
votes
4answers
4k views

Encrypt directory with GnuPG?

Is there any way to encrypt a directory using gpg? It seems to only accept files as arguments.
5
votes
2answers
3k views

GnuPG : representations of key IDs and fingerprints

In gpg's man page, there are examples of key IDs : 234567C4 0F34E556E 01347A56A 0xAB123456 234AABBCC34567C4 0F323456784E56EAB 01AB3FED1347A5612 0x234AABBCC34567C4 and fingerprints : ...
1
vote
1answer
409 views

Export format of gpg [closed]

What is the binary export / import format used bygpg for public and private keys?
0
votes
1answer
54 views

How to prevent curl output from printing a preceding pipe's output?

I have a command piping an encrypted gpg stream into curl: echo "Some Text" | gpg -o - | curl --silent -T - \ -X PUT \ --output /dev/null \ ${myurl} \ When running this, I see something ...
79
votes
8answers
168k views

keyserver timed out when trying to add a GPG public key

I am trying to add a public key for installing a program with CPG. But I am pretty new to this but every command I found gave me the same error: gpg --keyserver keyserver.ubuntu.com --recv-keys ...
88
votes
4answers
120k views

How to export a GPG private key and public key to a file

I have generated keys using GPG, by executing the following command gpg --gen-key Now I need to export the key pair to a file; i.e., private and public keys to private.pgp and public.pgp, ...
117
votes
2answers
154k views

gpg: keyserver receive failed: No dirmngr

While trying to receive keys in my Debian Stretch server, I get this error: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF Executing: /...
20
votes
4answers
16k views

Encrypt OfflineIMAP Password

I'm trying to set up OfflineIMAP to authenticate via a gpg encrypted file (that way I can consolidate all my encryption to my gpg-agent process). From the documentation, it seems the only way to ...
52
votes
4answers
86k views

Unable to add gpg key with apt-key behind a proxy

Adding a gpg key via apt-key systematically fails since I've switched to Ubuntu 17.04 (I doubt it's directly related though). Example with Spotify's repo key: $ sudo apt-key adv --keyserver hkp://...
30
votes
3answers
31k views

“No such file or directory” when generating a gpg key

I'm trying to generate a gpg key $ gpg --full-gen-key but eventurally I get an error gpg: agent_genkey failed: No such file or directory Key generation failed: No such file or directory I'm on ...
31
votes
5answers
33k views

I try to add passwords to the “pass” password manager. But my attempts fail with “no public key” GPG errors. Why?

I am trying to install Pass: the standard Unix password manager, however, when I try to add passwords to the appliation I get these errors gpg: Kelly's Passwords: skipped: No public key gpg: [stdin]: ...
18
votes
1answer
11k views

How to configure gpg to enter passphrase only once per session

Is it posible to configure gpg in a way that I enter passphrase only once, and it will work for the whole session (I'm using Ubuntu/XFce)? I'm not sure how gpg works, it seems that the default ...
13
votes
1answer
8k views

How to change passphrase for pass (password manager)

I changed the password for my gpg key. However, beforehand I've built an password store via pass with the same gpg key. Now, whenever I query passwords, I still get asked for my old gpg password. ...
9
votes
2answers
6k views

Change pinentry program temporarily with gpg-agent

I use gpg-agent sometimes with no X display or over ssh, so my config file contains: pinentry-program /usr/bin/pinentry-curses This way, the gpg passphrase is requested in curses. That said, in ...
9
votes
2answers
3k views

RSA 2048 keypair generation: via openssl 0.5s via gpg 30s, why the difference?

RSA 2048 keypair generation: via openssl 0.5s via gpg 30s, why the difference There are several programs which can gerate RSA public/private keypairs GnuPG/OpenPGP for instance has a wizzard being ...
24
votes
1answer
9k views

GPG Hangs When Private Keys are Accessed

I like to sign my git commits with my PGP key, so I was quite alarmed when I went to git commit -S but instead of prompting for my PGP key passphrase, git just started hanging. I haven't made a change ...
12
votes
1answer
3k views

Best Practices for SSH, tmux & GnuPG Agent

I'm attempting to consolidate my encryption software to GnuPG, and I'm running into a confusing problem. My primary unit is a headless server, and I exclusively work in tmux. There is no X session, ...
8
votes
3answers
4k views

Is there a way to source an encrypted (GPG) file on-the-fly in a script?

I need a bash script to source a file that is encrypted, as the file being sourced contains sensitive information. I would like the script to prompt for the GPG passphrase and then run, sourcing the ...
8
votes
3answers
11k views

When importing a key during a yum installation, where is that key stored?

I'm installing a piece of software for which I had to use a third-party repository. After adding the repository with rpm -Uvh http://[site], I installed with yum install [package]. One of the ...
5
votes
1answer
4k views

How can I import a key in PEM format (not OpenPGP) into GPG?

I have data like this: -----BEGIN PRIVATE KEY----- MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDPzCORz9kUh4yt 73fiG1amQ16jwjXNzNO0d4xUWlrCP3dTfXnvtF35r2N/5Nefw9CcztBUAZACbwtn (... just sample ...
4
votes
2answers
3k views

Repo APT secure - apt-get update GPG signature were invalid [closed]

After setting up a new apt repository with aptly, signing the repository, serving the repository with aptly and adding the public gpg key to the apt keyring, I encounter a failure during the apt ...
3
votes
1answer
2k views

How to configure gpg2 to pass smartcard PIN unless pinentry programm?

My configuration: Centos 6.5 gnugp2-2.0.14-6.el6_4.x86_64 gnupg2-smime-2.0.14-6.el6_4.x86_64 I configured gpg2 to use my signature key in smartcard gnupg V2.0. I imported my gpg signature key to the ...
16
votes
5answers
18k views

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 ...
10
votes
2answers
6k views

How to edit a .gpg file with vi?

So I created a gpg encrypted file with password: gpg -c passwords.txt.gpg how can I open it with vi, edit it, then close it? (So that no passwords.txt file will be created, the decrypted passwords....
10
votes
3answers
5k views

Adding “random number entropy” for GPG keys?

In the following video: Linux HOWTO: Secure Your Data with PGP, Part 2, you are shown how to create a key pair with gpg. At about 1:50, the instructor says the following: While the key is being ...
8
votes
3answers
4k views

Receive Pop/IMAP email and then forward as encrypted to gmail

Basically, I have an email account I can access as POP3 or IMAP. I want to take all incoming emails, encrypt them, and then forward the encrypted version to my gmail account (so I can see the subject/...
6
votes
1answer
737 views

measure amount of data read from /dev/random

background I have written a collection of bash scripts (most of them in German only yet but if you are interested; download the archive not the single scripts) which help users create high-quality ...
6
votes
1answer
3k views

Connecting SSH and Git to gpg-agent

I'm running a YubiKey NEO with the OpenPGP applet to store my GPG keys on the smart card. I've stopped all other SSH and GPG agents manually by removing their startup entries (On elementary OS Luna, ...
6
votes
2answers
2k views

Using pass on multiple computers. Which pgp key to share?

I'm using pass password manager on multiple computers, linked via a git repository. Which pgp key do I need to share across computers, the public, private, or both, so that I can add /edit /delete ...
5
votes
5answers
12k views

gpg: cancelled by user

Trying to create GPG keys which will be used for an apt repository hosted on my Centos7 box. I created a new user "apt", and then tried to create the keys, but at the very end, it states that I need ...
5
votes
1answer
3k views

Debian: GPG cannot fetch Linux Kernel key

I am in the process of recompiling the kernel on Debian. Following the instructions on kernel.org, the first step is to verify the signature. But GPG complains that it cannot find the public key: # ...
4
votes
1answer
2k views

Security of bash script involving gpg symmetric encryption

Notice: the very same vulnerability has been discussed in this question, but the different setting of the problem (in my case I don't need to store the passphrase) allows for a different solution (i.e....
4
votes
1answer
2k views

Automated Clonezilla backup and GPG encryption

I have a desktop Linux system which I regularly create clones of to a local RAID-6 array using Clonezilla. It's proven to be quite a hassle to walk through the backup process, which takes quite a few ...
3
votes
2answers
905 views

Why is it sometimes necessary to manually import keys?

There are many packages on AUR which, when you attempt to install them, result in an error like: ==> ERROR: One or more PGP signatures could not be verified! This is resolved by importing the key ...
3
votes
2answers
4k views

How to shutdown and restart dirmngr?

dirmngr is used by python-apt and is recommended by gnupg and gpgsm. I tried to shutdown dirmngr as shared in the manpage but got this - └─[$] dirmngr -vv --shutdown dirmngr[9494]: error opening '/...
3
votes
4answers
3k views

Skype missing GPG key

I wanted to install Skype on Scientific Linux 6.1: yum install alsa-lib.i686 dbus-libs.i686 e2fsprogs-libs.i686 expat.i686 fontconfig.i686 freetype.i686 glib2.i686 glibc.i686 keyutils-libs.i686 krb5-...
3
votes
1answer
2k views

gpg problem in using pass password manager

I would like to use the "pass" password manager. I don't seem to be able to get pass to recognize my public key. $ gpg2 --list-keys /home/johndoe/.gnupg/pubring.gpg ------------------------------- ...
1
vote
2answers
1k views

gpg2 pinentry fails without X

What is working My gpg-agent pinentry works fine under X. I can run echo "test" | gpg2 -ase --default-recipient-self | gpg2 to cache my passwords and later run killall gpg-agent -1 to flush them. ...
0
votes
1answer
4k views

How do I add custom GPG key to Ubuntu/Debian installer?

I'm trying to setup custom Ubuntu install CD using instructions on http://beezari.livejournal.com/191717.html I've added my GPG key to ubuntu-keyring and signed Release file with it (resulting in ...
0
votes
1answer
356 views

Always passing -A (--askpass) to sudo

I would like sudo to always do as if I had passed the -A (--askpass) option. I would like that so that sudo always uses my gnupg agent and password store. It already works if I pass -A manually, but ...