I encrypted a file by using the following command from a stackoverflow answer:
openssl enc -in file_name -aes-256-cbc -pass stdin -out file_name.aes;
I can decrypt this file by running:
openssl enc -in file_name.aes -d -aes-256-cbc -pass stdin -out file_name
However, the decryption command only works in the machine where I encrypted the file (CentOS). If I copy the encrypted file file_name.aes
over to my other machine (running on Fedora) and I try to decrypt it, I get an error message:
140667230762896:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:592:
Which suggests I am typing the wrong password. Is OpenSSL aes encryption system depedent? Why can I only decrypt the file in CentOS but not in Fedora?
openssl
versions are still in use. (enc
is terrible by the way, you probably shouldn't use it)OpenSSL 1.0.2k-fips 26 Jan 2017
on CentOS andOpenSSL 1.1.0i-fips 14 Aug 2018
on Fedora. I will consider using GnuPG as suggested in your linked answer.