PGP encryption in Linux

2.4k Views Asked by At

How should I encrypt a file using gpg linux command with PGP public key?

I have searched on google and I found this command

gpg --output doc.gpg --encrypt --recipient [email protected] doc

but I didn't find where to keep the public key in the command.

2

There are 2 best solutions below

0
On BEST ANSWER

If, as you said, you already have a key file, then you need to gpg --import that key into your keyring.

After that, you can gpg --list-keys to see the email address that you have to use as the argument to --recipient.

5
On

You have already specified it using --recipient option. Please check manual page or try gpg --help.