Quantcast

Use of command line openssl.exe

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Use of command line openssl.exe

Marina
Hi everyone
 I have been requested to fill a field  344 characters long with a crypted string .
 My program uses a batch command  to produce this string (cf.enc.b64) , starting from a string 16 char long (cf.inp)

openssl rsautl -encrypt -in cf.inp -out CF.enc -inkey farma-fur.cer -certin -pkcs  
openssl base64 -base64 -e -in cf.enc -out cf.enc.b64

I get a string with 6  '0x0A'  , and my length is 350 !
Is there some parameter to avoid these charachters ?

Sorry for my English , thanks in advance to any help
Marina
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of command line openssl.exe

Viktor Dukhovni

> On Apr 5, 2017, at 6:23 AM, Marina <[hidden email]> wrote:
>
> I have been requested to fill a field  344 characters long with a crypted
> string.

Why?

> My program uses a command to produce this string (cf.enc.b64),
> starting from a string 16 char long (cf.inp)
>
>    $ openssl rsautl -encrypt -in cf.inp -out CF.enc -inkey farma-fur.cer -certin -pkcs
>    $ openssl base64 -base64 -e -in cf.enc -out cf.enc.b64
>
> I get a string with 6 '0x0A', and my length is 350!

Those are newline characters.  The openssl base64 encoder output is
chunked in lines of 64 characters each.  So for 344 bytes of base64
output you'd expect 6 newlines.

> Is there some parameter to avoid these charachters?

Yes, the "-A" option to "openssl base64" suppresses the newlines.
Your second command should be:

    $ openssl base64 -A -in cf.enc -out cf.enc.b64

The "-e" and "-base64" options are not needed (default behaviour of
"base64").

--
        Viktor.

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use of command line openssl.exe

Marina
Mr Victor , it works !!! You have taken me out of a great trouble !!!
I'd image it could be easy but I could not understand how to do.
Thanks a lot

Marina
(Milano , Italy)
Viktor Dukhovni wrote
> On Apr 5, 2017, at 6:23 AM, Marina <[hidden email]> wrote:
>
> I have been requested to fill a field  344 characters long with a crypted
> string.

Why?

> My program uses a command to produce this string (cf.enc.b64),
> starting from a string 16 char long (cf.inp)
>
>    $ openssl rsautl -encrypt -in cf.inp -out CF.enc -inkey farma-fur.cer -certin -pkcs
>    $ openssl base64 -base64 -e -in cf.enc -out cf.enc.b64
>
> I get a string with 6 '0x0A', and my length is 350!

Those are newline characters.  The openssl base64 encoder output is
chunked in lines of 64 characters each.  So for 344 bytes of base64
output you'd expect 6 newlines.

> Is there some parameter to avoid these charachters?

Yes, the "-A" option to "openssl base64" suppresses the newlines.
Your second command should be:

    $ openssl base64 -A -in cf.enc -out cf.enc.b64

The "-e" and "-base64" options are not needed (default behaviour of
"base64").

--
        Viktor.

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Loading...