Two cracking methods for PHP base64_decode_PHP tutorial

WBOY
Release: 2016-07-13 17:37:54
Original
1083 people have browsed it

PHP base64_decode+gzinflate compression encoding and decoding code

PHP is being used more and more on the Internet, and the topic of encryption and decryption has never stopped. The following is a brief introduction to the base64_decode+gzinflate compression encoding and decoding code method, which is the encryption method in the form of eval(gzinflate(base64_decode(encryption code))); that we usually see in programs.
There is such a method on the Internet, but due to the partial lack of certain characters, it cannot be used after encryption. If you are interested, you can give it a try. I made simple modifications based on the original, and there is no error after testing.
Note: When decrypting, please do not use Chinese or names with spaces as file names

Compression encoding (encryption) code:


Quote content
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 it is writable, compress it and encode it
$contents = file_get_contents($filename); // Determine whether the file has been encoded
$pos = strpos($contents,powered by arzn QQ:1314778);
if(false === $pos || $pos>100){ // Remove comments and blanks from PHP files to reduce file size
$contents = php_strip_whitespace($filename);
// Remove PHP header and trailer tags
$headerPos = strpos($contents, $footerPos = strrpos($contents,?>);
$contents = substr($contents,$headerPos+5,$footerPos-$headerPos);
$encode = base64_encode(gzdeflate($contents));//Start encoding
$encode = ";
return file_put_contents($filename,$encode);
}
}
return false;
}
//Call function
$filename=code.php;
encode_file_contents($filename);
echo "OK, encryption completed!"
?>


Compression decoding (decryption) code:


Quote content

$Code = Fill in the code to be decrypted here; // base64 encoding
$File = decoded.php;//File saved after decoding
$Temp = base64_decode($Code);
$temp = gzinflate($Temp);
$FP = fopen($File,"w");
fwrite($FP,$temp);
fclose($FP);
echo "Decryption successful!";
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486537.htmlTechArticlePHP base64_decode+gzinflate compression encoding and decoding code PHP is currently used more and more in the network, encryption and decryption The topic has never stopped. Here is a brief introduction to base64_d...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!