2

How to encrypt a file using the command below, if the recipient mail is not showing up when I type the --list-keys command.

Sample Encrypt file command using GPG

gpg --output "output_filename" --encrypt --recipient blake@cyb.org "input_filename"

Output for gpg --list-keys shows to imported public keys one is User_A which shows an email. However another one Company ABC doesn't show an email. Which command can I use to encrypt the file and send it to Company ABC where they can decrypt it using their private key?

pub   2048R/4XXXX4E4 2016-08-29
uid       [ultimate] User_A <User_A@Test.com>
sub   2048R/DXXXX7E 2016-08-29


pub   1024D/FXXXXX3D 2007-01-20
uid       [ unknown] Company ABC
sub   2048g/7XXXXXE 2007-01-20
4

You can use the identifier instead of an email address:

gpg --output "output_filename" --encrypt --recipient FXXXXX3D "input_filename"

(You should really specify the full fingerprint but that's another story.)

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.