PHP Classes

PHP Ghost Crypt: Encrypt PHP code and generate self decrypting code

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (12)   Blog (1)    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 64%Total: 1,000 All time: 3,647 This week: 560Up
Version Licenses PHP version Categories
ghost 2.6Artistic License, G...5.3.3PHP 5, Cryptography, Code Generation


This class can encrypt PHP code and generate self decrypting code.

It can take a given PHP script and encrypts its code with a given key.

The class generates an output script that contains the encrypted code in comment lines starting with #:# and code to decrypt and execute the encrypted code.

Innovation Award
PHP Programming Innovation award nominee
November 2015
Number 2
Sometimes it is necessary to obfuscate the code of PHP scripts to make it harder for non-expert users to understand what the code does or change it.

This class can obfuscate PHP scripts by encrypting the code and generating a script that when executed will decrypt the code and execute it like the original version of the script.

Manuel Lemos
Picture of Nick Daniels
  Performance   Level  
Name: Nick Daniels <contact>
Classes: 13 packages by
Country: United States United States
Age: 34
All time rank: 1107160 in United States United States
Week rank: 30 Up3 in United States United States Up
Innovation award
Innovation award
Nominee: 4x

Winner: 1x




require_once 'GhostCrypt.class.php';

$gcrypt = new GhostCrypt("infile.php", ".enc.php", "PubKey");

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example File
Plain text file GhostCrypt.class.php Class GhostCrypt Class File
Plain text file GhostHash.class.php Class GhostHash Class File
Accessible without login Plain text file infile.enc.php Output Example Infile encrypted
Accessible without login Plain text file infile.php Aux. Example Infile to encrypt

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:3,647
This week:560Up
User Ratings User Comments (1)
 All time
8 years ago (Haseeb Ahmad Basil)