On Linux, I can generate an enc message using,

gpg --recipient Alice --encrypt source.txt

How can I force it to print to stdout, instead of writing to source.txt.asc?


gpg --recipient Alice --encrypt --armor --output - source.txt

1 Answer 1


Using the --output option.

gpg --recipient Alice --output - --encrypt source.txt

should sent the encrypted message to stdout.

  • You will want to use --armor so its is readable ASCII not binary Sep 1, 2015 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.