views:

118

answers:

7

Guys/Gals I have made a website but now I want to encode the script so that no one can copy.

I'm using PHP, JavaScript and HTML in each page of my website. So how do I encrypt each and every page?

Thank You.

A: 

Try using Javascript Obfuscator for your javascripts. It will not hide you script but it protects JavaScript code from stealing and shrinks size.

yonan2236
There are plenty of De-Obfuscators around.
griegs
+8  A: 

PHP

No need to encrypt - noone will ever see it (unless your site has security problems).

JavaScript

You can pack it. Can be reversed.

HTML

You can remove all whitespace. This is problematic with pre and white-space: pre.


The Most Important Part

Obfuscate to make pages load faster - not to stop people from stealing your code/markup. If your code is really worth stealing (which I doubt it, no offense), then people will get it.

alex
And why make it slower?
griegs
@griegs Sorry, I don't understand?
alex
I mean why force a decrypt on html? It's not like html is a big secret known only to a few right?
griegs
@griegs I think I know what you mean. It's not like a (good) professional web developer can't look at pretty much every site on the web and *know* how it was done just by observing it.
alex
Exactly and you're enforcing a performance hit by having to de-crypt something that's essentially on screen anyway. if you have hidden fields on the page that need security then maybe the page is not the best place for it
griegs
Mind you, have you seen 5416339's webpage. Maybe a little paranoid to begin with. :)
griegs
+1 for the last part.
Bobby
A: 

if you do a google on "html encryption" you'll get a lot of hits.

http://www.developingwebs.net/tools/htmlencrypter.php

The question I have is why you would want to do this? You're going to have a performance hit for what gain?

You can also do the same for javascript but unless your html or javascript has organisational sensitive data then... And if they do then perhaps that's not the best place for it.

griegs
They're user unfriendly, as users with JavaScript disabled won't be able to see your website.
Andrew Dunn
+1  A: 

Just get comfortable with the idea that putting something on the web is to open it to the world.

Cost in attempting to stop duplication of the stuff you've already decided to make publicly available: $your hourly rate x hours == ??

Cost to stop worrying about something that doesn't actually cost you anything: zero. winner.

(And to head off another question you're inevitably going to ask at some point in future - Don't attempt to disable right-clicks. It just annoys everyone and doesn't achieve anything.)

heist
+2  A: 

Neither html nor javascript can be encrypted, else the browsers would not be able to interprete it and your visitors would not be able to view your site. Dot. End. Compression tools may boost performance a little but will not really help against copyright infringement.

Your php-programs generate html, your visitors will always be able to see your html, but if your server is configured properly no one should ever see your php.

A: 

Actually one way to do it is to use XML + XSLT, it's extremely difficult for a lay-person to figure out what is going on, even more difficult for them to get your sauce code.

Andrew Dunn
A layperson probably won't attempt to do anything with your code anyway, and everybody else will just process the XML, as the browser needs to anyway, and they get the result. Also: Mmmmm, sauce code... ^_^
deceze
True, but I don't thing the average person who steals source/sauce code will even know what an XSL Transformation is, let alone how to reverse it. Besides, you can do trippy stuff, like making all of your html tags backwards `<lmth><daeh><eltit>My Website</eltit></daeh><ydob>...</ydob></lmth>` It's the closest thing to html encryption there is.
Andrew Dunn
And the shortest way to the madhouse, too. :D
deceze
A: 

search google for ioncube http://www.ioncube.com/html_encoder.php

This converts the html into gibberish. Stealing your html becomes difficult.

Nobody's html code is worth stealing anyways. This is only for self satisfaction.

Karthik Kottapalli
HTML encoder = horrible waste of time. Also relies on Javascript, which is bad. +0.5 for the last sentence though.
deceze
@Karthik Sounds like search engines would have a hard time indexing your site too.
alex