Jump to content
xisto Community
shiv

To Hide Your Source Code all you need to know to hide your source code..

Recommended Posts

protect your source code!

follow these easy 5 steps:

Notice from szupie:

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.

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

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

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

Share this post


Link to post
Share on other sites

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) :o even though it's only HTML, CSS and a little Javascript.

Share this post


Link to post
Share on other sites

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 :o

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 :P

 

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 :o

 

 

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

 

Regards:

Samya Khalid

Share this post


Link to post
Share on other sites

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! :lol:

Share this post


Link to post
Share on other sites

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 :P

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Nice.. I might consider using this especially with some sites I have my own design.Don't you just hate it when you have worked ages on a design and in the end it just looks like some profesional made it, only to find out that someone has stole the images and html etc..Great job on finding this out mate.. Also Is there some kind of script to hide your images if people try to copy them onto their pc or download them or whatever.. because as above i have made some images that i have worked ages on then i see some people have stole them.Once again, thanks for this. I'll try to make it more plain if i can by removing the javascript incase some of my visitors do have javascript disabled. Very unlikely in my opinion though.-HellFire

Share this post


Link to post
Share on other sites

I have hard time understanding what HTML code would be so amazing that it needs to be encrypted. Surely it's a shame when a design that you've spent a lot of effort to do gets stolen but I don't think it can be prevented by encrypting the code. It's the ideas and the design that gets stolen not the code, although stealing the code makes the job possible for an idiot. Images on the other hand would be nice to get protected. People steal images from webpages contantly and shamelessly use them on their websites. And some don't even seem to care if they get caught. For example I've used my self made animated gifs as avatars on some discussion forums. Now the animations weren't anyhting amazing and I didn't really mind that much but some people fromt he very same forums copied and used my avatar. Without asking.

Share this post


Link to post
Share on other sites

Although you can make it difficult to see the page source, it is IMPOSSIBLE to hide it. There is absolutle no way to totally hide your source. The webbrowser needs to see your source in order to parse it. No sorce = blank page. There really is not much of a reasong to hide your source. If your afraid of hotlinkers a norightclick will keep the average user away, and a php md5 hash or htaccess will make it impossible.

Share this post


Link to post
Share on other sites
hiding source codseTo Hide Your Source Code

Good Evening sir/madam

 I put the above code as it is ,but it is not working .And by click on your example an error is coming.

I have one doubt in the index.Htm page are you given only the script but you didn't explain where to put that code means in the body tag or head tag.

if index.Htm page contains only that script then the out put is not coming.Means while execute the page on browser a white page(without any data is )coming.

please explain me about this.

Thanks & Regards

Anu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.