[openssl-users] openssl des-ede3-cbc does not match with Java one

Jay Foster jayf0ster at roadrunner.com
Tue Nov 24 17:19:59 UTC 2015


It is very likely that your text file also contains a newline at the 
end, so getting the same result as with the echo command would be 
expected.  If it is indeed the newline that is making the difference, 
you could try using the echo command with the '-n' option to suppress it.

Jay

On 11/24/2015 9:12 AM, David García wrote:
> Sorry, still not getting the same result, now with the command:
>
> echo 005863330 | openssl enc -e -des-ede3-cbc -K 
> 'b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b' -iv 00000000 
> -nosalt | openssl enc -base64
>
> I get:
>
> H6cr2yN8oWXn2RxiDqnXLg==
>
> but I should get:
>
> H6cr2yN8oWUVY3a6/Vaaow==
>
>
> BTW I get the same result if the text in the echo is between '' or is 
> read from a text file.
>
> 2015-11-24 18:07 GMT+01:00 David García <garcia.narbona at gmail.com 
> <mailto:garcia.narbona at gmail.com>>:
>
>     You are right Viktor, that was my problem.
>
>     Thank you very much for your help Viktor and Michael.
>
>     2015-11-24 18:00 GMT+01:00 Viktor Dukhovni
>     <openssl-users at dukhovni.org <mailto:openssl-users at dukhovni.org>>:
>
>         On Tue, Nov 24, 2015 at 05:55:42PM +0100, David García wrote:
>
>         > openssl enc -e -des-ede3-cbc -in myfile.txt -k
>         > 'b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b' -iv
>         00000000 -nosalt |
>         > openssl enc -base64
>
>         Please read Michael's message carefully. Note the comment about
>         "-k" vs. "-K" (upper-case).
>
>         --
>                 Viktor.
>         _______________________________________________
>         openssl-users mailing list
>         To unsubscribe:
>         https://mta.openssl.org/mailman/listinfo/openssl-users
>
>
>
>
>     -- 
>     David
>
>
>
>
> -- 
> David
>
>
> _______________________________________________
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151124/91f0002a/attachment.html>


More information about the openssl-users mailing list