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): openssl enc -e -des-ede3-cbc -in myfile.txt -k 'b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b' -iv 00000000 -nosalt | openssl enc -base64 myfile.txt (edited with vim) contains the string: 005863330 The value I get is: SYqzNH5u8ExzyakWO3Cj/A== meanwhile the one I am getting from Java and PHP examples is: H6cr2yN8oWUVY3a6/Vaaow== Regards. 2015-11-24 16:28 GMT+01:00 Michael Wojcik <Michael.Wojcik at microfocus.com>: > > > echo 'text_to_cypher' | openssl enc -e -des-ede3-cbc -k > 'b2aec78eb50e04f2a60b9efa20b82c903e3cad4f3bd2027g' -iv 00000000 -nosalt | > openssl enc -base64 > > 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.) > > 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)? > > > -- > Michael Wojcik > Technology Specialist, Micro Focus > > _______________________________________________ > openssl-users mailing list > To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users > -- David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151124/a5ec9555/attachment.html>