I have a php document repository application running on windows apache, this application will aes-encrypt any uploaded document with the following command:
e
I found the solution :-), the problem is the windows echo command adds three characters to the end of password, that are space,CR and LF characters, and the linux echo command seems to not feed those characters and so the openssl command is not receiving the same password used to encrypt.
The solution was to add those three characters to the password in Linux, that is possible because the echo command has escape sequences to insert hexadecimal values.So, following my example, the correct decrypt command that is now working for me in linux is:
echo $'MyPass34\x20\x0d\x0a' | /usr/bin/openssl aes-256-cbc -pass stdin -d -in somefile.pdf -out decriptedfile.pdf
Hope this can help someone!