<div dir="ltr">I am sorry, I pasted an invalid key I was playing with to check some other things. Next, the real key and now reading the value from a file instead from echo (BTW I am using a linux terminal):<div><br></div><div>openssl enc -e -des-ede3-cbc -in myfile.txt -k 'b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b' -iv 00000000 -nosalt | openssl enc -base64<br></div><div><br></div><div>myfile.txt (edited with vim) contains the string:</div><div><br></div><div>005863330</div><div><br></div><div>The value I get is:</div><div><br></div><div>SYqzNH5u8ExzyakWO3Cj/A==</div><div><br></div><div>meanwhile the one I am getting from Java and PHP examples is: </div><div><br></div><div>H6cr2yN8oWUVY3a6/Vaaow==<br></div><div><br></div><div><br></div><div>Regards.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-24 16:28 GMT+01:00 Michael Wojcik <span dir="ltr"><<a href="mailto:Michael.Wojcik@microfocus.com" target="_blank">Michael.Wojcik@microfocus.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> echo 'text_to_cypher' | openssl enc -e -des-ede3-cbc -k 'b2aec78eb50e04f2a60b9efa20b82c903e3cad4f3bd2027g' -iv 00000000 -nosalt | openssl enc -base64<br>
<br>
</span>That echo command will append a LF (x'0a') byte (if this is a conventional UNIX or Linux system, or Cygwin, etc, and you're running under one of the standard shells). Do you have that byte in the value of your "cleartext" variable in the Java code? You failed to supply that. (Also, the single-quote characters are unnecessary, unless you're running a very odd shell.)<br>
<br>
The value of the -k argument you're passing to "openssl enc" ends with "g", which is not a hexadecimal digit; the rest of the value appears to be hexadecimal. But it's not clear why you're using -k anyway. Perhaps you mean to use -K (uppercase K, with an actual hexadecimal argument)?<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Michael Wojcik<br>
Technology Specialist, Micro Focus<br>
<br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">David</div>
</div>