Encode and encrypt the PHP source code
03 |
function randabc ($length = "") {//return random string |
06 |
$str = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
07 |
Return Str_shuffle ($STR); |
12 |
$filepath = ' index.php '; |
13 |
$path _parts= pathinfo ($filepath); |
14 |
$filename = $path _parts["basename"]; |
16 |
$T _k1=randabc ()/With secret key 1 |
18 |
$T _k2=randabc ()/With secret key 2 |
21st |
$vstr =file_get_contents ($filename);//files to be encrypted |
23 |
$v 1=base64_encode ($VSTR); |
26 |
$c =strtr ($v 1, $T _k1, $T _k2);//replace the corresponding character according to the key. |
29 |
$c = $T _k1. $T _k2. $c; |
|
$s = ' $ '. $q 6. ' =urldecode ("%6e1%7a%62%2f%6d%615%5c%76%740%6928%2d%70%78%75%71%79%2a6%6c%72%6b%64%679%5f%65%68%63%73%77%6f4%2b %6637%6A "); $ '. $q 1. ' =$ '. $q 6. ' {3}.$ '. $q 6. ' {6}.$ '. $q 6. ' {33}.$ '. $q 6. ' {30};$ '. $q 3. ' =$ '. $q 6. ' {33}.$ '. $q 6. ' {10}.$ '. $q 6. ' {24}.$ '. $q 6. ' {10}.$ '. $q 6. ' {24};$ '. $q 4. ' =$ '. $q 3. ' {0}.$ '. $q 6. ' {18}.$ '. $q 6. ' {3}.$ '. $q 3. ' {0}.$ '. $q 3. ' {1}.$ '. $q 6. ' {24};$ '. $q 5. ' =$ '. $q 6. ' {7}.$ '. $q 6. ' {13};$ '. $q 1. " =$ '. $q 6. ' {22}.$ '. $q 6. ' {36}.$ '. $q 6. ' {29}.$ '. $q 6. ' {26}.$ '. $q 6. ' {30}.$ '. $q 6. ' {32}.$ '. $q 6. ' {35}.$ '. $q 6. ' {26}.$ '. $q 6. ' {30};eval ($ '. $q 1. " ("'. Base64_encode (' $ ') $q 2." = "'. $c. '"; eval (\ ' >\ '. $ ') $q 1. ' ($ '. $q 3. " ($ '. $q 4. " ($ '. $q 2. ', $ '. $q 5. ' *2), $ '. $q 4. ' ($ '. $q 2. ', $ '. $q 5. ', $ '. $q 5. '), $ '. $q 4. ' ($ '. $q 2. ', 0,$ '. $q 5))); '; |
46 |
Generate the encrypted PHP file |
47 |
!is_dir (' create/') && mkdir (' create/'); |
48 |
$FPP 1 = fopen (' create/'. $filename, ' W '); |
49 |
Fwrite ($FPP 1, $s) or die (' Write file error '); |
50 |
Echo ' Encryption succeeded! '; |