Pages

Wednesday, February 16, 2011

PHP Obfuscator (POBS) to Encrypt PHP Code

This is the software package focused on in this arcicle. It does not need additional server PHP modules installed in order to run. It's easy to install and easy to use. The main feature is the actual PHP encryption, with many configuration options. The PHP Obfuscator is available for download from their home page.

How To install POBS
First you need to download it. This is easily done from the home page (see link above). The software is distributed in a .zip file. Just save it to your desktop and open it up. Qouting the INSTALL instructions for POBS:

"Installing POBS is as easy as I could think of. Just unzip the downloaded file and put it a directory that is located under your webserver. POBS is a collection of files in just 1 directory."

Easy as pie! Now, since POBS is itself written using PHP, you need a web server to run the script. A tutorial for installing a web server is easy to find using a favourite web search engine of your choice. Now, let's assume the .zip file is unpacked and the POBS files are residing on your web server, for example in this directory: "c:\wwwroot\pobs".

How To use POBS
Using a favourite web browser of your choice, navigate to your new POBS directory. E.g: "http://www.mysite.com/pobs". When using your local computer, use "localhost" instead of "www.mysite.com". You will be presented with a nice POBS interface screen. Blue and purple/gray seems to be the chosen theme for this program. There are several options consisting of both textboxes and checkboxes. The default values are fine but can be changed as the user (YOU) sees fit. Feel free to experiment with the options. No harm can be done since the program will not run unless source and target directories are different.

How To configure POBS
Let's have a look at the options:

TimeOut (sec) - This option is not editable. It is read from your PHP configuration and is meant as a safety measure in order to let the web server encrypt the files until it is done. If this value is too small, the encryption will be stopped half way. This might happen if the PHP configuration is set to safe mode, but is often easy to remedy. The default of 5000 secs is fine.
Source Directory - is the local directory where the PHP files to be encrypted are stored. Note that this is not a "http://" address, but rather a "c:/wwwroot/php" address. One thing to be careful of is the use of "/" instead of "\". An ordinary local address "c:\wwwroot" is written "c:/wwwroot".
Target Directory - is, of course, the directory where you want the encrypted files to end up. The same rules as source directory apply here.
Replacements - Here is the good stuff. Checking or unchecking these boxes means that a type of conversion is to be made or not to be made. For example, the "variables" option means that the PHP variables will be substituted with garbage characters, to obfuscate the code and ruin the readability. The more you choose, the better is the encryption. Note that some options might make the code invalid! If any problems occur, try unchecking the boxes one by one until usable code is produced. Avoid that checkbox and everything should work fine.
Removals - The same principle works here. Mark the boxes in order to further obfuscate the code.
File System - Here are some vital options.
Replace edited files only - means that only the encrypted PHP files will be transferred to the target directory.
Recursive scan - The whole directory tree, including subdirectories of your source directory will be processed. Very useful for encrypting entire web sites.
Copy all files - Marking this checkbox will make POBS copy all the files in the source directory. Pictures, stylesheets, animations, movies. Everything will end up in the new directory. This is perfect for making the new encrypted PHP site easily integrated into the live environment.
Copyright Text - Well, since you are making the code closed source, you might as well include a copyright notice. This notice will be readable to the naked eye and hopefully deter any reverse engineering attempts.
How To start the machine
You're ready to go! Click the "Start Processing" button in the bottom of the page. POBS will commence encryption according to your options. This might take a while. Take a break, read the magazine, drink a cup of hot coco and it will be finished when you return.

The final page that POBS shows it the status report. This is a very detailed page displaying everything that has happened and what files that has been processed. Take a few minutes going though this page and check if it looks alright.

You're done
Yep, that was it. You have encrypted the PHP files and can distribute and/or sell your software without any concerns about copyright violations. Well done!


source: http://www.seocompany.ca/software/free-encryption-software.html

1 comment: