views:

234

answers:

4

I'd like to protect the PHP and JavaScript program source code from the prying eyes of my client. How can I do that?

+1  A: 

If someone has access to your source code it will always be susceptible. The best you can do is obfuscate it ala Google-JS style but it can always be reverse-engineered.

And what makes your application so special anyway? Unless it's some sort of program for something like the government I don't think you should really give a care.

meder
er... my boss think it is important.. ... :P
Ted Wong
Tell him he’s an idiot.
Bombe
@Ted Wong - I have had the same problem with my boss for some .Net systems .. so I feel you pain .. lol
Peter M
@Bombe - some of us enjoy being employed :)
DVK
+5  A: 

your javascript source is fair game I'm afraid. You can minify it, you can obscure it and compress it but you can't hide it.

if you are storing PHP files on your clients server, then this issue will be difficult to overcome also.

Apparently there are some PHP encrypters available but they have an adverse affect on performance.

So yeah, not much you can do really. Especially if your client is technically savvy.

Evernoob
IMO all you need to do is make breaking into your system (slightly) more expensive than buying a new license from you then thats about as best as you can do on an adhoc basis. After that you have to start investing in all sorts of other technologies that will screw around with things [ie Port your php to C++ ]
Peter M
+1  A: 

Use a javascript obfuscator.

Jasob :: JavaScript Obfuscator - CSS Obfuscator

Although it won't be 100% irreversible. Just makes it hard to read and understand.

For PHP

PHP Obfuscator

and

Code Eclipse

rahul
+1  A: 

Given you are using a scripting language that is interpreted at runtime, your options are limited:

1) Run the most sensitive parts of your application on your own server and have the client access them over web services.

2) Code obfuscation (this is reversible with enough effort).

Asaph