Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obfuscate PHP code [closed]

I create software using PHP. I'm going to sell this software so I need to protect my source code so that nobody can view it. How can I protect my PHP code so that the software still functions the same?

I also need to bind the software to a particular, authorized PC. It should not run on any other PC. How can I do that? Should I encrypt using LAN MAC address? Does anyone have any other ideas?

like image 470
riad Avatar asked Apr 19 '09 06:04

riad


People also ask

Can PHP be obfuscated?

A PHP Obfuscator does the work of scrambling the source code of PHP script in order to make people find it very difficult to understand. Important things like the variable name, class, interface and function names are being replaced by PHP Obfuscators to something not meaningful.

How do I make my PHP code not readable?

If you'd really want to make it unreadable and inaccessible use APC or OPcache. Set the TTL to 0 and delete all files. Your website is delivered only from the cached files.

How do I protect my PHP source code?

The only way to really protect your php-applications from other, is to not share the source code. If you post you code somewhere online, or send it to you customers by some medium, other people than you have access to the code. You could add an unique watermark to every single copy of your code.

Can you obfuscate obfuscated code?

Obfuscation means to make something difficult to understand. Programming code is often obfuscated to protect intellectual property or trade secrets, and to prevent an attacker from reverse engineering a proprietary software program. Encrypting some or all of a program's code is one obfuscation method.


2 Answers

What you may be looking for is not cryptography per se, but rather obfuscation. If you Google for "php obfuscate", many choices show up. The first one is from Raizlabs.

like image 40
Chris Morley Avatar answered Oct 06 '22 09:10

Chris Morley


I put together the following list a ways back - don't know if they are all current, or how many are now free, but you should find something useful here:

About:

  1. Wikipedia article: PHP Accelerator
  2. Comparison of APC, Zend, xCache, & the Zend Framework

Software:

  1. Safeyar (Best)
  2. PHP's APC (PECL page)
  3. RoadSend
  4. Turck-mmcache
  5. eAccelerator
  6. PHP-Accelerator
  7. SourceGuardian
  8. NuSphere Nu-coder
  9. Gridinsoft
  10. IonCube SA-Encoder.php

Another thread on SO that adds a few more (check it out):

Can I encrypt PHP source or compile it so others can't see it? and how?

  1. Zend Guard
  2. BCompiler (PECL page)
  3. PHC
like image 101
SamGoody Avatar answered Oct 06 '22 10:10

SamGoody