Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How am I supposed to use gpg to symmetrically encrypt a file? When I run gpg --symmetric filename, then it prompts me for passwords as expected, and generates a filename.gpg file. However, when I run gpg -d filename.gpg, it returns

gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected

without asking for the password

share|improve this question
up vote 3 down vote accepted

Recent versions of GnuPG come with a helper program gpg-agent, which handles the key and password operations and acts as a password cache. It could be that gpg-agent has cached the password you just entered.

To flush the cache, use either:

  • echo reloadagent | gpg-connect-agent

  • send SIGHUP: pkill -HUP -U $USER gpg-agent

share|improve this answer
fantastic, thanks!! – gatoatigrado Jun 7 '11 at 20:39
When encrypting is there a way to tell gpg not to cache passwords? – nullUser Jan 8 '14 at 23:07
@nullUser: It's always done by gpg-agent, so you can set very low cache-ttl's in ~/.gnupg/gpg-agent.conf. – grawity Jan 9 '14 at 12:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .