Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> To Hide Your Source Code, all you need to know to hide your source code..
shiv
post Mar 20 2006, 09:11 PM
Post #1


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 53
Joined: 20-March 06
Member No.: 12,139



protect your source code!

follow these easy 5 steps:


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
Go to the top of the page
 
+Quote Post
Houdini
post Mar 21 2006, 12:53 AM
Post #2


Super Member
Group Icon

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.
Go to the top of the page
 
+Quote Post
techocian
post Mar 21 2006, 03:16 AM
Post #3


'Prentice de-Zighner
Group Icon

Group: Members
Posts: 368
Joined: 23-January 05
From: USA
Member No.: 2,290



QUOTE(Houdini @ Mar 21 2006, 08:53 AM) *

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) laugh.gif even though it's only HTML, CSS and a little Javascript.
Go to the top of the page
 
+Quote Post
Samya
post Mar 21 2006, 09:37 AM
Post #4


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 35
Joined: 20-March 06
From: Karachi
Member No.: 12,138



QUOTE(techocian @ Mar 21 2006, 08:16 AM) *

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 smile.gif
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 smile.gif

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 smile.gif


**** All Appreciations and Criticisms are welcome ****

Regards:
Samya Khalid
Go to the top of the page
 
+Quote Post
Kushika
post Apr 10 2006, 06:27 PM
Post #5


Member [ Level 2 ]
Group Icon

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! wink.gif
Go to the top of the page
 
+Quote Post
erinekath
post Apr 16 2006, 12:02 AM
Post #6


Newbie [ Level 2 ]
Group Icon

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 biggrin.gif) Just find the source encrypter script and when they show you the example, use it. It's way better. smile.gif
Go to the top of the page
 
+Quote Post
html_man
post May 1 2006, 06:24 PM
Post #7


Newbie [ Level 1 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
WeaponX
post May 1 2006, 11:56 PM
Post #8


Way Out Of Control - You need a life :)
Group Icon

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 biggrin.gif
Go to the top of the page
 
+Quote Post
Lyon2
post May 17 2006, 07:08 AM
Post #9


Newbie [ Level 1 ]
Group Icon

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.
Go to the top of the page
 
+Quote Post
Termin-X-man
post May 21 2006, 08:40 PM
Post #10


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 13
Joined: 21-May 06
Member No.: 13,580



That's cool, I might consider using this.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Basic css code(2)
  2. Code To Send An Email From A Form(10)
  3. Best Open Source Cms...(6)
  4. Simple Java Script Code For Print Pages(0)
  5. Jscript/html/css Code Help(8)
  6. Free Shoutbox? HTML, Flash or PHP Code(24)
  7. I Need Help With A Code: Myspace Profile Css(5)
  8. Blogger Code Problems(1)
  9. Home Videos(4)
  10. Free Code Snippets And Css Layout(14)
  11. Code Improvement And Optimization(2)
  12. Javascript Show / Hide Functions(3)
  13. The Step Up. A Guide For Myspace Design(2)


 



- Lo-Fi Version Time is now: 11th October 2008 - 11:45 AM