Virtual machine supports SG11 extension

Dear user, the cloud virtual machine PHP5.6 and 7.0 environments already support the SG11 loader, which supports running programs encrypted through sg11.

SourceGuardian is an excellent PHP source code encryption tool, which can effectively protect the code. The official website address is: https://www.sourceguardian.com/

From phpinfo(), we can see that the extension has been installed:

How to encrypt

You need to purchase an encryption program from SourceGuardian. After installation, select a local PHP project for encryption. The following shows a simple code for encryption. The source code is as follows:

 <? php   function ip_in_range( $ip, $range ) {   if ( strpos( $range, '/' ) == false ) { $range .= '/ 32'; } // $range is in IP/CIDR format eg 127.0.0.1/24 list( $range, $netmask ) = explode( '/', $range, 2 ); $range_decimal = ip2long( $range ); $ip_decimal = ip2long( $ip ); $wildcard_decimal = pow( 2, ( 32 - $netmask ) ) - 1; $netmask_decimal = ~ $wildcard_decimal; return ( ( $ip_decimal & $netmask_decimal ) == ( $range_decimal & $netmask_decimal ) ); } var_dump(ip_in_range('8.8.8.8', '8.8.8.0/24'));

Open the encryption program and select the file to start encryption:

Click "encode" to see that encryption has been completed:

The procedure to check the encryption is as follows:

Upload the encrypted program to the virtual machine and verify it through the curl access program:

 [ mingming6@bx219.onlinemgr  ~]$ curl ' http://1.lazysingle2.sc2yun.com/sg11/example.php ' bool(true)   [ mingming6@bx219.onlinemgr  ~]$ curl ' http://1.lazysingle2.sc2yun.com/sg11/example_encode.php ' bool(true)

You can see that the return values of unencrypted and encrypted programs are consistent.