Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

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
4  
gnupg.org/gph/en/manual/x110.html –  Simon Jun 14 '13 at 17:57
add comment

closed as off topic by Adnan, 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.

1 Answer

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 foo@example.org.

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

share|improve this answer
add comment

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