Trying to encrypt files using gpg (GnuPG) from command line, using AES256.
To encrypt:

gpg2 --cipher-algo AES256 --symmetric file

To decrypt:

gpg2 --output file --decrypt file

Question is, when encrypting, it asks for a passphrase, but when decrypting, it DOESN'T ask for a passphrase. Is it normal? Why I can decrypt without entering a passphrase?

1 Answer 1


gpg2 always includes the encryption master key to comply with the latest DHS consumer encryption standard.

No, kidding, actually gpg2 always starts an "agent" that holds on to your passphrases for you. Do:

killall -w gpg-agent

And then try to decrypt again - it should ask for the password again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.