Encryption/decryption doesn't work well between two different openssl versions
<p>I've downloaded and compiled <code>openssl-1.1.0</code>.</p>

<p>I can encrypt and decrypt using the same exe of <code>openssl</code> (as is <a href="https://stackoverflow.com/questions/16056135/how-to-use-openssl-to-encrypt-decrypt-files">here</a>)</p>

<pre><code>me@ubuntu:~/openssl-1.1.0$ LD_LIBRARY_PATH=. ./apps/openssl aes-256-cbc -a -salt -in file.txt -out file.txt.enc
enter aes-256-cbc encryption password: 123
Verifying - enter aes-256-cbc encryption password:
me@ubuntu:~/openssl-1.1.0$ LD_LIBRARY_PATH=. apps/openssl aes-256-cbc -a -d -in file.txt.enc -out file.txt.dec
enter aes-256-cbc decryption password: 123
</code></pre>

<p>This <code>openssl</code> uses: <code>libcrypto.so.1.1, libssl.so.1.1</code></p>

<p>When I try to decrypt with the <code>openssl</code> installed on my ubuntu, which uses: 
<code>/lib/x86_64-linux-gnu/libssl.so.1.0.0, /lib/x86_64-linux-gnu/libcrypto.so.1.0.0</code></p>

<p>I get an error:</p>

<pre><code>me@ubuntu:~/openssl-1.1.0$ openssl aes-256-cbc -a -d -in file.txt.enc -out file.txt.dec2
enter aes-256-cbc decryption password: 123
bad decrypt
140456117421728:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:539:
</code></pre>

<p>What may cause this?
Thanks</p>