Super User is a question and answer site for computer enthusiasts and power users. 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

When I use gpg to encrypt files, I can use -c, or --symmetric, and also -a for armor.

-c, --symmetric     encryption only with symmetric cipher
-a, --armor           create ascii armored output

How can I add -g, so that the command would be gpg -c -g AES25, instead of gpg -c --cipher-algo AES25?

share|improve this question
up vote 2 down vote accepted

You can't do it directly with gpg. The code which is compiled to make gpg supports certain command line options, and some of those have aliases, but it's not something you change directly.

You could write a script/wrapper for gpg (say, call it my-gpg) which took one set of command line options and then converted them into the options gpg expects.

So you could write the script, and then use,

my-gpg -c -g AES25

and the script would in turn run

gpg -c -cipher-algo AES25

But you'd need to implement that yourself. You could use a simple bash alias to achieve the same thing as well.

share|improve this answer
thanks for ur reply but if so bash alias easier. – rezx May 12 '12 at 11:44
Yep, an alias or some other similar process (personally, I consider aliases the same as scripts). – EightBitTony May 12 '12 at 11:47
thanks, i did it and its work – rezx May 12 '12 at 11:51
@rezx don't forget to mark answers that help as Answered. – EightBitTony May 12 '12 at 17:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .