LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-19-2015, 08:31 AM   #1
boby.kumar
Member
 
Registered: Mar 2013
Posts: 92

Rep: Reputation: Disabled
showing openssl encrypted file output in multi line format.


Hi,
I have encrypted a file using openssl and getting the encrypted file contents in multi line instead of single line.
commands as follows:

Quote:
/usr/local/ssl/bin/openssl enc -e -a -des3 -in input.xml -out out.xml -K 2FEA9BDA7A9BA8FB798FAB7F9E0E1AAE2FEA9BDA7A9BA8FB -iv 219C56BE0EC46
File output as :
Quote:
user@locahost# cat out.xml
sac24lt6dNvrrYLfeK72FCHZW7hw/7fgLaCeI/Lkl2eZqBrq4/X/xd0jM42WXjNR
EuOJr5Fn2AbD92SfVDJ8FA1Yk9BqYpS7bQBNeGu+RHPH8JWTYcLclbvldmBRGNiE
zwQNQtLdvKoecArPD3Z1rHImtxThmZWzJFEL4o95cHoIseK5I5ROpoAbDX+zfcFT
SkPGyez+gNNFw6VeDEpZt4pec6w2a8O2ze1jfHUcyiY20/jR9hX2qsTvdGr9+DkV
46DA6ebPDJM3q0SVf7E7QdOHVuzXVV2ZbGJ/vlDpw6vqiAUD90o9OfCNJVD+RSEP
y3NiOTlpgOMR5Z6VEN/99ofElJ5hCV0G
I am looking to have this output in a single line by openssl. tried lot of but the thing is same.

Can openssl do it in a single line ? or any utilty that can do the same .

Thanks in Advance
 
Old 11-20-2015, 12:37 AM   #2
boby.kumar
Member
 
Registered: Mar 2013
Posts: 92

Original Poster
Rep: Reputation: Disabled
hi,

Can anyone help here ?
 
Old 11-20-2015, 12:54 AM   #3
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
A bit impatient, perhaps?

Why do you need it on a single line?

Perhaps this works:
Code:
/usr/local/ssl/bin/openssl ... (without options -a, -out) ... | base64 -w 0 > out.xml
In other words, you don't ask openssl for the base64 encoding, but use the base64 command. Thanks to -w 0, there are no line breaks.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
openssl encrypted file is giving cannot execute binary file error Aashika Linux - Newbie 4 06-30-2015 02:04 PM
[SOLVED] multi-line output from a bash script using echo and tr Leo Simon Linux - General 7 08-15-2012 03:05 AM
Store multi-line output into an array in a Linux bash script steven.c.banks Linux - General 2 12-17-2009 10:10 AM
ssh lock up on multi line output Incanus Linux - Networking 0 07-20-2004 09:47 PM
grepping for multi-line output born4linux Programming 1 03-07-2003 03:26 AM


All times are GMT -5. The time now is 08:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration