Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenSSL: -pbkdf2 option no longer supported?

Until recently I was able to encrypt/decrypt files using the following commands:

Encrypt:

openssl enc -aes-256-cbc -pbkdf2 -in un_encrypted.yml -out encrypted.data

Decrypt:

openssl enc -d -aes-256-cbc -pbkdf2 -in encrypted.data -out un_encrypted.yml

I recently updated my Homebrew packages and it seems the -pbkdf2 option is no longer supported? I cannot get it to work and I keep getting a help prompt on how to use the openssl command (I’ve been using the above commands for several years now). Simply removing the -pbkdf2 option results in a corrupt output file.

Does anyone know how I can decrypt files again?

  • MacOS Catalina 10.15.4
  • OpenSSL 1.1.1g

Thanks in advance

like image 850
DaniG2k Avatar asked May 21 '20 16:05

DaniG2k


People also ask

Is OpenSSL installed on Linux by default?

Installation. openssl is installed by default on Arch Linux (as a dependency of coreutils). There are various OpenSSL library bindings available for developers: python-pyopenssl.


1 Answers

More than likely you are using the default openssl, which is LibreSSL, that comes with MacOS. LibreSSL does not support pbkdf2 as far as I could tell, so you should upgrade to full blown openssl.

To find out if you are using LibreSSL run: openssl version

To upgrade to openssl:

brew update
brew install openssl
# if it is already installed, update it:
brew upgrade [email protected]

The last step is to ensure that it is in your path before the default:

echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
like image 70
Sixty4Bit Avatar answered Oct 19 '22 16:10

Sixty4Bit