Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It is easy to decrypt an encrypted textfile with:

 gpg --decrypt /tmp/message 

But how can I encrypt my own textfile?

share|improve this question

closed as off topic by Adi, TildalWave, Terry Chia, Xander, Gilles Jun 15 '13 at 18:45

Questions on Information Security Stack Exchange are expected to relate to Information security within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

4 – Simon Jun 14 '13 at 17:57
up vote 3 down vote accepted

Encrypting is as easy as decrypting:

gpg --encrypt /tmp/message

GnuPG will now ask you for the key(s) to encrypt to. The encrypted message will be stored to the same path with .gpg extension. The output file can be set using --output /path/to/encrypted/file.

You can also include the recipient as parameter, useful for scripting gpg, add --recipient

For more options, read man gpg and the GnuPG manual.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.