alphadevx / alpha

Full-stack MVC framework for PHP.
http://www.alphaframework.org/
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Fix use of aes-256-ecb for encryption #360

Closed alphadevx closed 3 years ago

alphadevx commented 4 years ago

It seems the ECB algorithms like aes-256-ecb are deprecated. Furthermore, in PHP 7.4 this method now throws a breaking exception when the openssl_random_pseudo_bytes() is called using the aes-256-ecb algorithm (when openssl_cipher_iv_length('aes-256-ecb') always returns 0):

openssl_random_pseudo_bytes($ivsize)

Length must be greater than 0

Suggest we do the following:

  1. Make the default algorithm something else.
  2. Make the algorithm configurable, so that existing applications using aes-256-ecb can continue to do so after upgrading to PHP 7.4.
  3. Fix support for aes-256-ecb to avoid breaking any apps using Alpha.