how to hide source code?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
nadeem14375
Forum Newbie
Posts: 23
Joined: Sat Oct 30, 2010 2:11 am

how to hide source code?

Post by nadeem14375 »

Dear all,

Me new to php and web development.
I have a small project, to develop an accounting software for a company. I want to develop that in mysql and php.
As the php is open source, the software will be easily copied and edited by others.
Can I hide the code as we do by compiling and generating exe files in other tools, so no one can see the source code?

Regards:
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: how to hide source code?

Post by twinedev »

You could try one of these:

ionCube: http://www.ioncube.com/sa_encoder.php ($200)

Zend Guard: http://www.zend.com/en/products/guard ($600)
Peter Kelly
Forum Contributor
Posts: 143
Joined: Fri Jan 14, 2011 5:33 pm
Location: England
Contact:

Re: how to hide source code?

Post by Peter Kelly »

nadeem14375 wrote:Dear all,

Me new to php and web development.
I have a small project, to develop an accounting software for a company. I want to develop that in mysql and php.
As the php is open source, the software will be easily copied and edited by others.
Can I hide the code as we do by compiling and generating exe files in other tools, so no one can see the source code?

Regards:
As was mentioned you can use ioncube to encrypt the file disabling anyone editing the file inside without it going corrupt. Obviously though when the page is put on the big wide world the html, css, js etc are unencrypted when someone visits the page just to make sure your aware :)
Hermit TL
Forum Commoner
Posts: 69
Joined: Mon Nov 21, 2011 12:16 am

Re: how to hide source code?

Post by Hermit TL »

As the php is open source, the software will be easily copied and edited by others.
Just to clarify (as many new to php get this wrong), the source of the php script is not viewable in the users' browser in the same way one would be able to view a raw HTML document. The end user will never see the php script (without hacking) only the HTML(/CSS/Javascript, or whatever) that is output to the browser.

@debtelinda
anyone who have ideas about how to hide source code?
That is exactly what this thread is about, why would you post the same question again within this thread? And if you were trying to bump the thread, you did it wrong. See:faq.php#f2r12 If you are nadeem14375, you don't need a second account to bump the thread. (My most sincere apologies if that is not why that post is there.)(I'm not accusing anyone of anything, I've just seen that behavior before).
Burner
Forum Newbie
Posts: 5
Joined: Wed Mar 26, 2003 10:22 am

Re: how to hide source code?

Post by Burner »

If you're trying to hide your PHP code from prying eyes, you could upload it to a website that will obfuscate it for you. you can try out http://www.pipsomania.com/best_php_obfuscator.do or http://www.pipsomania.com/best_php_obfuscator.do. They are free and make your code unreadable by human eyes but still execute just fine.

Burner
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: how to hide source code?

Post by twinedev »

Burner wrote:http://www.pipsomania.com/best_php_obfuscator.do. They are free and make your code unreadable
A thing to note, if someone will be wanting to rip your code, the above service will protect you as little as disabling right click with javascript protects your content from getting stolen. (ie, those that it actually stops are no threat to your information)

-Greg
Burner
Forum Newbie
Posts: 5
Joined: Wed Mar 26, 2003 10:22 am

Re: how to hide source code?

Post by Burner »

I think your "protecting you as little as disabling right click with javascript" comment is a little harsh and oversimplifying this. The process to reconstruct obfuscated code is more labor intensive than just clicking "View Source" to bypass javascript's Right Click.

Of course if a code savant gains physical access to your source code there is little you can do against them. BUT, obfuscation does give you another layer of security that keeps out casual observers and simple code monkeys.

Burner
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: how to hide source code?

Post by twinedev »

Yes there are differences, and I wasn't referring to doing a view source, I was referring to people who use that thinking it will prevent anyone from saving out things like images on their site. But like I said I was comparing the two to the fact that the people that it actually "stops" will not be the people you would be concerned about IMO.

If I were to have something that I'm trying to copy or need to modify without paying for, I could easily in under an hour write a script to get me back the source code. in a form that I could work on it.

-Greg
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: how to hide source code?

Post by Benjamin »

nadeem14375 wrote:Dear all,

Me new to php and web development.
I have a small project, to develop an accounting software for a company. I want to develop that in mysql and php.
As the php is open source, the software will be easily copied and edited by others.
Can I hide the code as we do by compiling and generating exe files in other tools, so no one can see the source code?

Regards:
If a company is paying you to develop accounting software, you have absolutely no right to obfuscate it unless they are dumb enough to sign a contract allowing you to do that.
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: how to hide source code?

Post by twinedev »

Very good point Ben.

Just for the fun of it and since I had a 40 minute window with nothing to do, I wrote a script that get you back to "editable" source code from the site listed earlier: It is far from perfect, but it will get you back to pretty close, even handling indentation (well a for() statement breaks more than needed due to extra semicolons). I did notice the output of the other program puts all functions to the top of the output, but it does leave all original variable names in place (making it really easy to read). And depending on the code, may need some other tweaks, but this worked on three example files I gave it (one of them being WordPress's functions.php file)

The issue with leaving all original function/variable names being left in unchanged (well when it "decodes") was actually a little disappointing to me. The script does well for what it was made to do otherwise, why not replace all of them with non-meaning names. For their purpose, hopefully they are working on it.

A geek with too much time... that is me today. LOL Time to get back to paying work now.

-Greg

EDIT: I had posted my code here, but since it is in the same thread with the link to the site, didn't want to leave it here... Want to test it, PM the file the site gives ya.
jarofgreen
Forum Commoner
Posts: 71
Joined: Sun Jul 11, 2010 12:40 pm

Re: how to hide source code?

Post by jarofgreen »

Benjamin wrote:If a company is paying you to develop accounting software, you have absolutely no right to obfuscate it unless they are dumb enough to sign a contract allowing you to do that.
Yes. Not to mention the fact that if it's Open Source, you may legally not be allowed to as the Open Source license may require you to pass the full source on with the product. Even if it technically follows the Open Source license, many may feel its against the spirit of Open Source. Without knowing exactly what Open Source license is involved, what parts you are developing and what contract you have with the client it's impossible to say more.
rhecker
Forum Contributor
Posts: 178
Joined: Fri Jul 11, 2008 5:49 pm

Re: how to hide source code?

Post by rhecker »

If a company is paying you to develop accounting software, you have absolutely no right to obfuscate it unless they are dumb enough to sign a contract allowing you to do that.
Obviously you say that because you have never been in a situation where it makes sense.

Say you build a web application for one branch or department of an organization. In doing so you write some fairly involved script. If it would be possible for someone else to come along and easily deploy the application elsewhere, you may certainly have the right to protect your code or make sure you get paid for any use of it beyond the contract.

When I do a project that contains code I don't want to give away to the next developer who comes along, the code is licensed to the client, NOT SOLD.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: how to hide source code?

Post by Benjamin »

Well there's a sucker born every minute, I suppose.
Post Reply