LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   showing openssl encrypted file output in multi line format. (https://www.linuxquestions.org/questions/linux-newbie-8/showing-openssl-encrypted-file-output-in-multi-line-format-4175559298/)

boby.kumar 11-19-2015 07:31 AM

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

boby.kumar 11-19-2015 11:37 PM

hi,

Can anyone help here ?

berndbausch 11-19-2015 11:54 PM

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.


All times are GMT -5. The time now is 07:46 AM.