PHP Classes

PHP Obfuscate: Obfuscate PHP encrypting the source code

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 548 All time: 5,529 This week: 660Up
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: 227 Up2 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 (7)  
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 (7)  /  src  
File Role Description
Files folder imageObfuscator (1 file)
  Accessible without login Plain text file .htaccess Data Auxiliary data

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:548
This week:0
All time:5,529
This week:660Up