-1

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.

alex
  • 479,566
  • 201
  • 878
  • 984
5416339
  • 417
  • 3
  • 9
  • 18

9 Answers9

11

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.

It is also very ease to export the formatted DOM structure that is the end result of your serialised mess.


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
  • 479,566
  • 201
  • 878
  • 984
  • 1
    @griegs Sorry, I don't understand? – alex Sep 24 '10 at 05:30
  • I mean why force a decrypt on html? It's not like html is a big secret known only to a few right? – griegs Sep 24 '10 at 05:31
  • 1
    @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 Sep 24 '10 at 05:33
  • 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 Sep 24 '10 at 05:36
  • 2
    Mind you, have you seen 5416339's webpage. Maybe a little paranoid to begin with. :) – griegs Sep 24 '10 at 05:37
  • "No need to encrypt - noone will ever see it (unless your site has security problems)" Oh, really? I had to have a cross platform app that works on iPhone and PC. Since I don't see, why I should pay 30% tax to Jobs Inc., it's WEB app, written in PHP/mySQL/JS/HTML. And this is not a cause to require Internet on PCs as well as on iPhones. So, I've just taken Server2Go along with my own browser carcass... et voila -- EVERYone, not noone, can see the sources in Program Files (x86) folder. And I'm still looking for precompiling web-server instead of Server2Go, to make sort of binaries from PHP. – noober Nov 13 '11 at 22:26
  • And this http://www.roadsend.com/home/index.php?pageID=compiler seems to be what I need. – noober Nov 14 '11 at 10:00
3

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.

user456931
  • 54
  • 1
2

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
  • 21
  • 1
0

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

yonan2236
  • 13,371
  • 33
  • 95
  • 141
0

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
  • 22,624
  • 33
  • 128
  • 205
0

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.

Randy the Dev
  • 25,810
  • 6
  • 43
  • 54
  • 2
    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 Sep 24 '10 at 05:53
  • 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 `My Website...` It's the closest thing to html encryption there is. – Randy the Dev Sep 24 '10 at 06:08
  • 1
    And the shortest way to the madhouse, too. :D – deceze Sep 24 '10 at 06:18
0

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.

  • 2
    HTML encoder = horrible waste of time. Also relies on Javascript, which is bad. +0.5 for the last sentence though. – deceze Sep 24 '10 at 06:08
  • Sounds like search engines would have a hard time indexing your site too. – alex Sep 27 '10 at 15:19
0

The most I have ever been able to do to protect my code is to disable the right click with this line of code:

<body oncontextmenu="return false">

but it doesn't mean they can't right click on another page open inspect element and go back to your page and look at the code it can only stop them from viewing the source code for the most part.

0

Little late, by 10 years, but I've found a website that encrypts HTML. However, it doesn't work with PHP, it does work with JS. Evrsoft is what I've used for my website. It's the only HTML encryption I've found so far. If you've got PHP in your code, only encrypt the HTML in the page and leave the PHP raw. Nobody can see PHP anyway. It's a free service.

WaXxX333
  • 388
  • 1
  • 2
  • 11