PHP Classes

PHP Obfuscate: Obfuscate PHP encrypting the source code

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 548 This week: 1All time: 5,524 This week: 560Up
Version License PHP version Categories
php-obfuscate 1.1MIT/X Consortium ...5.3PHP 5, Cryptography, Language
Description 

Author

This class can obfuscate PHP encrypting the source code.

It takes a given PHP source code file, removes white space and comments, and encrypts the result code with a given key.

The class generates another PHP file that decrypts and executes the encrypted PHP code.

The class can encrypt the code multiple times up to a given level.

Picture of Rafael Espinosa
  Performance   Level  
Name: Rafael Espinosa <contact>
Classes: 6 packages by
Country: Cuba Cuba
Age: 36
All time rank: 19864 in Cuba Cuba
Week rank: 416 Up1 in Cuba Cuba Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php
if(!isset($_POST['clean_code']))
   
header('Location: index.php');

require_once(
__DIR__ . DIRECTORY_SEPARATOR . "vendor/autoload.php");

$obfuscator = new \Fluency\Component\Obfuscator\PhpObfuscator();
$cleanFileName = md5(uniqid()) . ".php";

file_put_contents($cleanFileName, $_POST['clean_code']);

$obfuscatedFileName = $obfuscator->obfuscate($cleanFileName);

$obfuscatedCode = file_get_contents($obfuscatedFileName);

unlink(__DIR__ . DIRECTORY_SEPARATOR . $cleanFileName);
unlink(__DIR__ . DIRECTORY_SEPARATOR . $obfuscatedFileName);

echo
"
    <h2>PHP Online Code Obfuscator</h2>
    <textarea cols=\"50\" rows=\"30\">
{$obfuscatedCode}</textarea>
    <a href=\"index.php\">Go Back</a>
"
;


Details

- Deploy on your web server. - Set appropiate permissions (Linux systems). - Run composer dump-autoload for class autoloading. - Try access trough http://localhost/php_obfuscator - Or include PhpObfuscator class on your project autoload system.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.php Data Example form
Accessible without login Plain text file LICENSE Data Auxiliary data
Accessible without login Plain text file obfuscator.php Example Example script
Accessible without login Plain text file README Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageObfuscator (1 file)
  Accessible without login Plain text file .htaccess Data Auxiliary data

  Files folder image Files  /  src  /  Obfuscator  
File Role Description
  Plain text file PhpObfuscator.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:548
This week:1
All time:5,524
This week:560Up