Openssl 1.1.1 cannot be decrypted on different machine

Viewed 306

I'm trying to encrypt a file that will be decrypted and deployed on a debian 11 server that I don't have access to. But every time I encrypt it. It doesn't work on different machine.

Encryption

openssl enc -aes-256-cbc -md sha512 -k *PASSWORD* -pbkdf2 -iter *NUMBERS* -salt -in *INPUT_FILE* -out *OUTPUT FILE*

Decryption

openssl enc -d -aes-256-cbc -md sha512 -k *PASSWORD* -pbkdf2 -iter *NUMBERS* -salt -in *INPUT_FILE* -out *OUTPUT FILE*

But every time I tried to decrypt it from a different machine it doens't work. Everytime and everywhere it always return

bad decrypt
*different_number_each_run*:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:crypto\evp\evp_enc.c:610:

I could only decrypt it on the machine that encrypt it. All that doesn't work that I have tried are

  1. Encrypted with openssl 3.0.1 on windows (on my laptop), decrypted with openssl 1.1.1k on debian 11 (Deployment Server)
  2. Encrypted with openssl 1.1.1m on windows (on my laptop), decrypted with openssl 1.1.1k on debian 11 (Deployment Server)
  3. Encrypted with openssl 1.1.1m on windows (on my laptop), decrypted with openssl 1.1.1d on debian 10 (on my laptop with wsl to a remote server A)
  4. Encrypted with openssl 1.1.1d on debian 10 (on my laptop with wsl to a remote server A), decrypted with openssl 1.1.1m on windows (on my laptop)
  5. Encrypted with openssl 1.1.1d on debian 10 (on my laptop with wsl to a remote server A), decrypted with openssl 1.1.1k on debian 11 (Deployment Server)
  6. Encrypted with openssl 1.1.1k on debian 11 (on my laptop with wsl to a remote server B), decrypted with openssl 1.1.1k on debian 11 (Deployment Server)
  7. Encrypted with openssl 1.1.1k on debian 11 (on my laptop with wsl to a remote server B), decrypted with openssl 1.1.1m on windows (on my laptop)

The only thing that always works if it's the same for example

  • Encrypted with openssl 1.1.1d on debian 10 (on my laptop with wsl to a remote server A), decrypted with openssl 1.1.1d on debian 10 (on my laptop with wsl to a remote server A)

And there's one weird exception that works

  • Encrypted with openssl 1.1.1k on debian 11 (on my laptop with wsl to a remote server B), decrypted with openssl 1.1.1d on debian 10 (on my laptop with wsl to a remote server A)

The most important part is at the end it should be decryptable on openssl 1.1.1k on debian 11 (Deployment Server)

0 Answers
Related