To better explain I used

gpg --output encrypt.txt --sign encrypt

to create an encrypted file that can be decrypted with my public key, but what I would like to do is to output an encrypted message in the following form:

-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1

mQINBFWUsdsBEAC/XoBBdYE3j41lIGB+FveMXcPrDHpVahBwYbzzgxnKIHyw7RsH eECJ7mGk+/o1l4oXJTCWdFUUIoCgLhERmx5kdft7Jvh3X8NHiKEszApSlAODW2YS UvwsbbMb9/ArevavQJ21Of5v0YBOS9Eb9JnczYmSbjYmewgAqsuF0BK9V1AiAkR1 cFn5Ao+cKE0F2oGjS12zCqw2O6z89Mb0eypGMNCMDgHUx30+e5QFzvHCx9A/lO+M vvV19wgLvbjfGAhRwtte2vWHQHoT8xuk97CZfSplyJ6DwZpGoBRgxTEeEpNAN33N nJ5kUgYBjECxP/


  • If what you're after is an encrypted message that anyone with access to a key can decrypt, you probably want symmetric encryption - this uses the same key for both encryption and decryption, and the key can be set at the time the message is encrypted. – Charles Green Jul 3 '15 at 1:16


gpg --encrypt --sign --armor -r person@email.com name_of_file

you can add a second -r (recipient) flag to encrypt it for both you and the intended recipient, so that you can view the file as well.

  • After posting the original question I kept on searching and digging through the man pages and eventually found that what I wanted to accomplish could be achieved by executing gpg --clearsign file_name – miggs97 Jul 3 '15 at 4:12
  • Glad you got what you wanted! – nixpower Jul 3 '15 at 12:04

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.