Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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