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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


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


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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


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


Expert 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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


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


Expert 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

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Post by barnettgs » Sat Nov 16, 2019 6:15 pm

There's a little mention of Opencart 2.2.0.0 running on PHP 7.x?

Has anyone running it yet, is there any changes that needs to be made? I have read some threads about mcrypt but not for version 2.2.0.0?

My wordpress installs have niggled me to upgrade to PHP 7. I can change it on Cpanel but just wanted to make sure.

Newbie

Posts

Joined
Thu Sep 16, 2010 3:01 am

Post by IP_CAM » Sun Nov 17, 2019 2:05 am

Most PHP 7 encryption.php files work for the different OC Versions, up from v.1.5.5 at least:
Opencart 1.5.6.4 & PHP 7 - PHP 7.2
https://www.opencart.com/index.php?rout ... n_id=34428
Last edited by IP_CAM on Sat Jan 23, 2021 11:48 am, edited 1 time in total.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Post by IP_CAM » Mon Nov 09, 2020 10:43 am

To complete this, I have been testing the different encryption.php Files,
found at the OC Extension Section, by Use of PHP v.7.4.13, in my OC v.1.5.6.4 /1.5.6.5
type Installations, and all seem to work with PHP v.7.4.13, in an unsecured HTTP://
Environment so far. But I cannot judge on Security, possibly, one of the Pro's could
share some 'inside-view' on such ... ;)
Ernie
Last edited by IP_CAM on Sat Jan 23, 2021 11:50 am, edited 1 time in total.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


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 20 guests