By default openssl crypto outputs this when encrypting a string:

$ crypto "foobar"
Encrypted string: 467bf74ec821
Plain string: foobar

The only part of that output I actually need is 467bf74ec821 and that's easily achieved with grep/cut

crypto "foobar" | grep "Encrypted" | cut -d " " -f3

Now I'm wondering if there is a flag that I can pass to crypto to just get the encrypted string so I can use it in my scripts without the need to run it through grep and cut?

The man pages of crypto don't say anything about flags nor does the online docs of openssl unless i'm missing something?

link|improve this question

67% accept rate
You could use the openssl enc command instead. – PaĆ­lo Ebermann Oct 26 '11 at 12:16
2  
@ChrisRamakers: where did you get the crypto command? – quanta Oct 27 '11 at 4:21
I doubt the crypto command you use is from OpenSSL. – yarek Mar 23 at 14:22
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.