Mcrypt is missing


#1

Hello, i have installed opencart on server, and i’m getting error:
Unknown: Function mcrypt_create_iv() is deprecated in /storage/ssd2/731/5456731/public_html/system/library/encryption.php on line 8

In a web i have found information, that it’s necesary to install mcrypt on server to fix this problem.
Is it possible?
link to my website:
https://shopcheker.000webhostapp.com/


#2

Try downgrading your PHP version to 5.6


#3

Head to library folder > encryption.php and download that file to back it up.

Then edit in File Manager and empty the file and paste the following

<?php
/**
 * @package		OpenCart
 * @author		Daniel Kerr
 * @copyright	Copyright (c) 2005 - 2017, OpenCart, Ltd. (https://www.opencart.com/)
 * @license		https://opensource.org/licenses/GPL-3.0
 * @link		https://www.opencart.com
*/

/**
* Encryption class
*/
final class Encryption {
	/**
     * 
     *
     * @param	string	$key
	 * @param	string	$value
	 * 
	 * @return	string
     */	
	public function encrypt($key, $value) {
		return strtr(base64_encode(openssl_encrypt($value, 'aes-256-cbc', hash('sha256', $key, true))), '+/=', '-_,');
	}
	
	/**
     * 
     *
     * @param	string	$key
	 * @param	string	$value
	 * 
	 * @return	string
     */
	public function decrypt($key, $value) {
		return trim(openssl_decrypt(base64_decode(strtr($value, '-_,', '+/=')), 'aes-256-cbc', hash('sha256', $key, true)));
	}
}

Just incase anyone in the future has this issue!

Sorry for the bump I just noticed you didn’t solve it :slight_smile: