Post by straightlight » Tue Aug 28, 2018 6:22 pm

Or … simply use this solution for the Encryption class: viewtopic.php?f=198&t=204707&p=725370#p725077

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by billynoah » Tue Oct 16, 2018 10:34 am

schiggi wrote:
Wed Jul 11, 2018 12:44 am
If I replace the old 2.3 library with your suggestion, will I run into problems with old orders, api or anything?
Sorry just saw this - yes it should work. I've since changed one line of code - the new version checks iv length in case encrypted string is invalid:

Code: Select all

final class Encryption {
	
	private $cipher = 'aes-256-ctr';
	private $digest = 'sha256';
	private $key;
	
	public function __construct($key) {
		$this->key = $key;
	}

	public function encrypt($value) {
		$key       = openssl_digest($this->key, $this->digest, true);
		$iv_length = openssl_cipher_iv_length($this->cipher);
		$iv        = openssl_random_pseudo_bytes($iv_length);
		return base64_encode($iv . openssl_encrypt($value, $this->cipher, $key, OPENSSL_RAW_DATA, $iv));
	}
	
	public function decrypt($value) {
		$result    = NULL;
		$key       = openssl_digest($this->key, $this->digest, true);
		$iv_length = openssl_cipher_iv_length($this->cipher);
		$value     = base64_decode($value);
		$iv        = substr($value, 0, $iv_length);
		$value     = substr($value, $iv_length);
		if (strlen($iv) == $iv_length) {
			$result = openssl_decrypt($value, $this->cipher, $key, OPENSSL_RAW_DATA, $iv);
		}
		return $result;
	}
}

Image


User avatar
Active Member

Posts

Joined
Tue Jan 15, 2013 12:46 pm

Post by straightlight » Wed Oct 17, 2018 7:14 am

I would rather recommend the use of this version: viewtopic.php?f=198&t=204707&p=725077#p725077

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Thu Oct 18, 2018 6:57 pm

straightlight wrote:
Wed Oct 17, 2018 7:14 am
I would rather recommend the use of this version: viewtopic.php?f=198&t=204707&p=725077#p725077
Read my latest post on that thread as to why that version will not work.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Sun Oct 21, 2018 1:15 am

Post replied.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by tomsag » Wed Nov 21, 2018 6:37 pm

Hi to all,
I'm trying to get my 1.5.6.4 running on PHP 7.2 and it seems that I'm only having this problem right now (after editing encyption.php):
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /(domain_name_deleted)/httpd.www/system/library/dompdf/include/autoload.inc.php on line 83 Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /(domain_name_deleted)/httpd.www/system/library/session.php on line 7Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /(domain_name_deleted)/httpd.www/system/library/session.php on line 8Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /(domain_name_deleted)/httpd.www/system/library/session.php on line 9Warning: session_set_cookie_params(): Cannot change session cookie parameters when headers already sent in /(domain_name_deleted)/httpd.www/system/library/session.php on line 11Warning: session_start(): Cannot start session when headers already sent in /(domain_name_deleted)/httpd.www/system/library/session.php on line 12

Any idea what is the problem and how to get it working?
Thank you in advance
Tom

Newbie

Posts

Joined
Wed Nov 21, 2018 6:32 pm

Post by ADD Creative » Thu Nov 22, 2018 3:30 am

You have an extension that uses a older version of the Dompdf PDF generator library. The rest of the errors are probably because you have display errors on.

To resolve you could do one of the following.

1. Switch off display error in the OpenCart settings and the display_errors setting of your php.ini. These should be off for a live store anyway. You could also switch off showing Deprecated notices. http://php.net/manual/en/errorfunc.conf ... -reporting
Be warned that a later version of PHP may remove the function completely and therefore stop working.

2. See if the extension author has update the extension to use a later version of the Dompdf PDF generator library.

3. Upgrade the library to a later version yourself or through a developer and fix any compatibility problems.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by IP_CAM » Thu Nov 22, 2018 9:03 am

And as general Note:
NOT all v.1.5.6.x Version Extensions will function under PHP-7.2x, and a
typical sample is this (otherways very needy) one, which refuses to further
function, as it comes by default:
Web Filemanager for OpenCart
https://www.opencart.com/index.php?rout ... n_id=20624
---
But I am testing a 1.5.6.5_rc Version, equipped with a steady raising amount of VqMod Extensions,
in addition to a bunch of additional Modules, and not one of them produced any PHP Version -
related Errors. So, it's not really a wide-spread problem, but one needs to be aware of it, in
'certain' Module/VqMod - Cases at least, possibly also with the PDF Add-On you use.
Ernie

PS: But I would probably NOT use an OC this way, but rather implement the whole works,
exept for VqModded ON/OFF Switches, into a 'final' Source, to so have everything built-in
by Default. It would make it mucho easier, to then add another range of VqMods,
without the need, to check, which one of the existing VqMods might include something,
keeping a new one from doing it's job. 8) :crazy: Just to have this mentioned too !
On the other hand, for testing purposes, VqMod is just a great thing to have. But it's
getting quite hard, after a while, to keep track of everything ... :D
---
Image Link:
download/file.php?mode=view&id=36081

Attachments

vqmod_extension_section_oc_1565_vqpro.jpg

vqmod_extension_section_oc_1565_vqpro.jpg (834.41 KiB) Viewed 66 times


For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 7 guests