When looking at other people’s php source code, we often see encrypted php code. So what is the principle of php encryption? How to decrypt it?
Obfuscation encryption
Encryption code: <?php
/**
* Created by PhpStorm.
* User: tioncico
* Date: 20-3-28
* Time: 9:59 am
*/
class Tioncico{
function testEcho(){
echo “Xianshike\n”;
}
}
$tioncico = new Tioncico();
$tioncico->testEcho();
After successful encryption:
Successful execution:
So, what is the encryption principle of this string of codes? /p>
It can be found that it is another eval package, continue to output:
Similarly, find the last eval, output:
Continue:
The code before encryption is obtained.
The principle of obfuscated encryption
The obfuscated encryption passes through repeated base64, then obfuscates the base64_encode, decode functions, and finally executes the decryption through eval. As long as you understand a little bit of the principle, you can decrypt successfully.
This article is an original article by Xian Shi Ke, you don’t need to contact me for reprinting, but please indicate that it is from Xian Shi Ke’s blog www.php20.cn