title: Replace Mcrypt Encription with OpenSSL Encription for OpenCart CMS
body: <p>I have <code>OpenCart 1.5.6.4</code> with <code>encryption.php</code> file in <code>system library folder</code>.<br>
  The codes in <code>encryption.php</code> are :</p>
  
  <pre><code>&lt;?php
  final class Encryption {
      private $key;
      private $iv;
  
      public function __construct($key) {
          $this-&gt;key = hash('sha256', $key, true);
          $this-&gt;iv = mcrypt_create_iv(32, MCRYPT_RAND);
      }
  
      public function encrypt($value) {
          return strtr(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this-&gt;key, $value, MCRYPT_MODE_ECB, $this-&gt;iv)), '+/=', '-_,');
      }
  
      public function decrypt($value) {
          return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this-&gt;key, base64_decode(strtr($value, '-_,', '+/=')), MCRYPT_MODE_ECB, $this-&gt;iv));
      }
  }
  ?&gt;
  </code></pre>
  
  <p>For migration from <code>php 5.6</code> to <code>php 7.2</code> , I need to replace <code>Mcrypt Encription</code> with <code>OpenSSL Encription</code>.<br>
  I have replaced <code>mcrypt_create_iv(32, MCRYPT_RAND)</code> with <code>openssl_random_pseudo_bytes(32, true)</code> , but for <code>encrypt function</code> and <code>decrypt function</code> , I do not know what <code>parameters</code> to use for these functions.<br>
  What changes needed in <code>encription.php</code> codes?</p>