|
|
|
|
![]() ![]() |
Mar 20 2006, 09:11 PM
Post
#1
|
|
|
Member [ Level 2 ] Group: Members Posts: 53 Joined: 20-March 06 Member No.: 12,139 |
protect your source code!
follow these easy 5 steps: Notice from szupie:
QUOTE Step 1: let's assume your main page is named index.htm. Rename index.htm to encrypt.htm. Step 2: open encrypt.htm source code and add the code below to the file, right after the opening BODY tag. CODE <script language=JavaScript>m='%3Cscript%20language%3DJavaScript%3E%3C%21--%0D%0A%0D%0Avar%20message%3D%22Function%20Disabled%21%22%3B%0D%0A%0D%0Afunction%20clickIE%28%29%20%20%7Bif%20%28document.all%29%20%7Balert%28message%29%3Breturn%20false%3B%7D%7D%0D%0Afunction%20clickNS%28e%29%20%7Bif%20%0D%0A%28document.layers%7C%7C%28document.getElementById%26%26%21document.all%29%29%20%7B%0D%0Aif%20%28e.which%3D%3D2%7C%7Ce.which%3D%3D3%29%20%7Balert%28message%29%3Breturn%20false%3B%7D%7D%7D%0D%0Aif%20%28document.layers%29%20%0D%0A%7Bdocument.captureEvents%28Event.MOUSEDOWN%29%3Bdocument.onmousedown%3DclickNS%3B%7D%0D%0Aelse%7Bdocument.onmouseup%3DclickNS%3Bdocument.oncontextmenu%3DclickIE%3B%7D%0D%0A%0D%0Adocument.oncontextmenu%3Dnew%20Function%28%22return%20false%22%29%0D%0A%0D%0A//%20--%3E%3C/script%3E';d=unescape(m);document.write(d);</script> Step 3: create a text file and name it index.htm (or whatever your main file was named originally). the contents of the new index.htm file is given below - the code below is all that will be contained in index.htm. CODE <script language=JavaScript>m='%3C%21--%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0D%0A%23%0D%0A%23%%3E';d=unescape(m);document.write(d);</script> Step 4: create a text file and name it encrypt.js. the contents of the new encrypt.js file is given below -this is all that will be contained in encrypt.js. CODE document.write('<title>||||| SOURCE CODE ENCRYPTION |||||</title>'); document.write('<frameset rows="100%,*" framespacing="0" border="0">'); document.write('<frame frameborder="0" name="topFrame" src="encrypt.htm" noresize="noresize" />'); document.write('</frameset>'); Step 5: copy all the files to your server (index.htm, encrypt.htm, and encrypt.js). all the files must be located in the same directory. then open the index.htm file. try to view the source code, then try to right click on the page. cheers! shiv |
|
|
|
Mar 21 2006, 12:53 AM
Post
#2
|
|
|
Super Member Group: Members Posts: 572 Joined: 25-April 05 From: Nashville Tennessee Member No.: 4,340 |
What happens if the user has java or javascript disabled? I guess it don't doo too much.
|
|
|
|
Mar 21 2006, 03:16 AM
Post
#3
|
|
|
'Prentice de-Zighner Group: Members Posts: 368 Joined: 23-January 05 From: USA Member No.: 2,290 |
What happens if the user has java or javascript disabled? I guess it don't doo too much. True, but with the most common IE browsers these days...i believe the default setting would be to allow Javascript. Though, i don't see why an average internet user will want to check up on your source code. Still, why would one need to enclose their source code anyway? I find myself feeling proud when someone emails me and complements on my code (seriously, this happened. During a web design competition i believe) |
|
|
|
Mar 21 2006, 09:37 AM
Post
#4
|
|
|
Member [ Level 1 ] Group: Members Posts: 35 Joined: 20-March 06 From: Karachi Member No.: 12,138 |
True, but with the most common IE browsers these days...i believe the default setting would be to allow Javascript. Though, i don't see why an average internet user will want to check up on your source code. Still, why would one need to enclose their source code anyway?. U are right I dont think that we should hide the source code by encrypting it ... First of all this makes the Page much more big in size, and thus taking more time to Load .... Furthermore, it will also make difficult for u to update the page Furthermore, by default the Javascript is activated but dont use excess of Javascript as it sometimes, irritates the visitor ... However, it is a good practice, if u have a downloasd site, something like Rapidshare etc, where u dont want to show the actual path of File ... But I dont think that any one amongst us gonna create such a site **** All Appreciations and Criticisms are welcome **** Regards: Samya Khalid |
|
|
|
Apr 10 2006, 06:27 PM
Post
#5
|
|
|
Member [ Level 2 ] Group: Members Posts: 72 Joined: 3-February 06 From: UK Member No.: 11,052 |
Although most people have javascript enabled, some people might use text-only browsers, and you have to htink of you whole audiene as a whole; you site has to have optimum cross-browser compatibility in order to gain as many visitors as you can!
|
|
|
|
Apr 16 2006, 12:02 AM
Post
#6
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 24 Joined: 15-April 06 Member No.: 12,778 |
Why don't you just use www.javascriptsource.com (I think that's the URL, I forgot
|
|
|
|
May 1 2006, 06:24 PM
Post
#7
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 8 Joined: 1-May 06 Member No.: 13,141 |
Hmm instead of doing that you can just block the right button of the mouse and put ur site on a single Frame and tadaaan! XD
|
|
|
|
May 1 2006, 11:56 PM
Post
#8
|
|
|
Way Out Of Control - You need a life :) Group: Members Posts: 1,086 Joined: 21-June 05 From: New York Member No.: 6,440 |
There's usually (always?) a way around these so-called "encryption" methods. They just encode it with a certain method but decoding it won't take too long. And like Samya mentioned earlier, it adds more bulk to the page file size.
There's a way around that right click button being blocked as well...one can always just go to View->Source and it should show it. I'm sure there's a way to get the code with or without those frames |
|
|
|
May 17 2006, 07:08 AM
Post
#9
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 7 Joined: 11-May 06 Member No.: 13,352 |
Thanks for this script, not very secure, but still is good for personal websites.
Now, for professional websites, i don't think that's the apropriate measure to take if one wants to protect the page or entire website source code, the wisest decision is to use a program with high quality algotithms, for instance, when i want to protect the source code of my clients website, wich is my source code after all, i use the following programs: Advanced HTML Encrypt & Password Protect (very very good) SourceGuardian 2.2 Pro (the best for php encryption) PHP Code Obfuscator (php script, it has simple and advanced method) Encrypt html pro (encrypts and protects from right click,view source,etc...) html password lock (it encrypt the code and also creates a login script in javascript, wich you can add as many users/passwords as you like) There are others, but i find the above much better, and i already tryed them. |
|
|
|
May 21 2006, 08:40 PM
Post
#10
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 13 Joined: 21-May 06 Member No.: 13,580 |
That's cool, I might consider using this.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 11:45 AM |