GPG Symmetric Encryption: No Secret Key

3

1

Using gpg 2.0.22 I do the following as user A:

A@~: touch tmp
A@~: gpg -c --cipher-algo AES256 tmp
A@~: chmod 777 tmp.gpg
A@~: su -l root -c 'mv tmp.gpg /'

Then, as user B:

B@~: gpg /tmp.gpg

Now I'm expecting to get asked for the passphrase... but instead I get this:

gpg: directory `/home/B/.gnupg' created
gpg: new configuration file `/home/B/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/B/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/B/.gnupg/secring.gpg' created
gpg: keyring `/home/B/.gnupg/pubring.gpg' created
gpg: AES256 encrypted data
gpg: cancelled by user
gpg: encrypted with 1 passphrase
gpg: decryption failed: No secret key

I thought all I needed with symmetric encryption was the passphrase?

Any help would be greatly appreciated.

user3513346

Posted 2014-11-13T04:33:32.653

Reputation: 31

Answers

0

Looks like this is a problem with permissions after using 'su'. See resource below:

http://lists.gnupg.org/pipermail/gnupg-users/2009-May/036544.html

I retried without using su and it worked.

user3513346

Posted 2014-11-13T04:33:32.653

Reputation: 31