PHP Code encryption
Remember I have a very good friend once poured bitter bitterness to me, originally he added half a month night shift, to others developed a set of PHP program, the result met a dishonest businessman, people received the source code said is the first test, and then disappeared, the phone does not pass, QQ is never online.
Think carefully, the use of PHP development program, are the source code, hard to write, anyone can take to casually change, this is really a headache problem.
1, then how to encrypt their own PHP code?
2, let the encrypted PHP code on someone else's computer can also run.
------to solve the idea----------------------
Make a space of your own, to test the time, put your own space.
------to solve the idea----------------------
Encryption or can be cracked, you can get a station to upload the code above, others can view the effect through the domain name, and so he paid the source to him
------to solve the idea----------------------
Reference:
encryption or can be cracked, you can get a station to upload the code to the above, others can view the effect through the domain name, and so he paid and then the source to him
Save As the code is only the page HTML, PHP can not see, or the programmer is not sad to urge the
------to solve the idea----------------------
Encryption of the PHP code has professional encryption software (charge), the encrypted code to be in the appropriate decryption environment to run
Pre-compilation of PHP code with Zend (charges, but pirated), precompiled code also requires a Zend virtual processor
Scrambling the PHP code to handle, the scrambling code can be understood as self-decryption encryption, run without special requirements
No matter what you do, the customer always gets the code to run. As for what customers do not do with this code, they only seek the protection of the law.
Although the Chinese are very smart, but because of lack of legal awareness, in the field of science and technology is always backward with the Americans, Japanese .....
------to solve the idea----------------------
Put your own space test, test it and give it again. Or take a secured transaction.
------to solve the idea----------------------
function Encode_file_contents ($filename) {
$type = Strtolower (substr (STRRCHR ($filename, '. '), 1));
if (' php ' = = $type && is_file ($filename) && is_writable ($filename)) {//If it is a PHP file and can be written with compression encoding
$contents = file_get_contents ($filename); Determine if the file has been encoded
$contents = Php_strip_whitespace ($filename);
Remove PHP header and tail markings
$headerPos = Strpos ($contents, ' $footerPos = Strrpos ($contents, '?> ');
$contents = substr ($contents, $headerPos + 5, $footerPos-$headerPos);
$encode = Base64_encode (Gzdeflate ($contents)); Start coding
$encode = ' ";
Return file_put_contents ($filename, $encode);
}
return false;
}
Calling functions
$filename = ' test.php ';
Encode_file_contents ($filename);
echo "OK, encryption done!" "?>