PHP Code encryption

Source: Internet
Author: User
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.


Reply to discussion (solution)

Make a space of your own, to test the time, put your own space.

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

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



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



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



If the code is not encrypted, he can not save the page by saving the code, pictures, scripts to download it down?

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


Save As the code is only the page HTML, PHP can not see, or the programmer is not sad to urge the


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


Save As the code is only the page HTML, PHP can not see, or the programmer is not sad to urge the



Okay, so how do you do the following features?
1, then how to encrypt their own PHP code?
2, let the encrypted PHP code on someone else's computer can also run.

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

Can I use MD5 to encrypt? Can I hack it after encryption?

MD5 is not encrypted, so there is no decryption.

Besides, if the other side of your encryption technology, that can not decrypt the source code it? So what's the point of encryption?

Put your own space test, test it and give it again. Or take a secured transaction.

!--? php
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 identification
$headerPos = Strpos ($contents, '!--? php ');
$footerPos = Strrpos ($contents, '?> ');
$contents = substr ($contents, $headerPos + 5, $footerPos-$headerPos);
$encode = Base64_encode (Gzdeflate ($contents));//start encoding
$encode = '!--? php '. "\ n eval (gzinflate (". ""). $encode. "'" . ")));\ N\n?--> ";

Return file_put_contents ($filename, $encode);
}
return false;
}

//Call function
$filename = ' test.php ';
Encode_file_contents ($filename);
echo "OK, encryption done!" "?>

There is no good way, generally, only provide the page, after payment to provide the source code

!--? php
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 identification
$headerPos = Strpos ($contents, '!--? php ');
$footerPos = Strrpos ($contents, '?> ');
$contents = substr ($contents, $headerPos + 5, $footerPos-$headerPos);
$encode = Base64_encode (Gzdeflate ($contents));//start encoding
$encode = '!--? php '. "\ n eval (gzinflate (". ""). $encode. "'" . ")));\ N\n?--> ";

Return file_put_contents ($filename, $encode);
}
return false;
}
//Call function
$filename = ' test.php ';
Encode_file_contents ($filename);
echo "OK, encryption done!" "?>



The original page content becomes
Eval (gzinflate (Base64_decode (' 41jiluvm0uivysxly0kssdvisixontojt0lnzk9j1vb3lhe0vdfu1lrwslcdaa== ')));
The result of the operation is not the original page

This is for the understanding, the general encryption is useless

I want the effect is that others see your source code is garbled, but can show the effect of running, as for the tolerance is not easy to crack first not to consider.

There are a lot of PHP encryption code AH, but it is easy to solve ~ ~ ~

Crack this area first without consideration, the realization of the previous

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.