NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Best Way to Keep Source Hidden

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
7 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 08-08-2003, 11:45 AM THREAD STARTER               #1 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



Best Way to Keep Source Hidden


Ok, here is what you do for the best possible defense against annoying source stealers -

First, add this to the page you want to protect or link your files to an external JS file:

<SCRIPT LANGUAGE="JavaScript">
<!--
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}

if (self.location == top.location)
{
top.location.replace("index.htm");
}
//-->
</SCRIPT>

After you have that, put your pages in a frames page (if you are worried people won't support frams then you are outta luck), and that will stop basic stealers.

There are still ways to view the source so, to stop that - 2 more steps.

To stop newbs put this at the top of every page or write it in with a server side script:

<!--------------------------------->
<!--------------------------------->
<!-- Information Secure -->
<!--------------------------------->
<!--------------------------------->
[ Add 2600 Enter Keys here]
????: NamePros.com http://www.namepros.com/code/15099-best-way-to-keep-source-hidden.html



Most people will close the window at first glance because on any resolution, the scrollbar is the smallest it goes.


And, for the final precaution, submit the sensitive part of your source code to the form in the following page.

http://www.angelfire.com/ny5/consigliere/encrypter.html

Happy Programming!

P.S this way is not foolproof, since data is stored on the clients computer in the temporary internet files folder, there is no true way to save your source code.
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Old 08-08-2003, 12:06 PM   #2 (permalink)
NamePros Member
Join Date: Jul 2003
Posts: 68
crEA-tEch is an unknown quantity at this point
 



unless you use php scripts =)
__________________
M-Factor
crEA-tEch
crEA-tEch is offline  
Old 08-08-2003, 02:04 PM   #3 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



It's not possible to hide the source code that displays the html output to the browser. You can attempt to make it harder to get, but I think it's all really a waste of time because if someone really wants it they will get it.

The only thing you can really do is make your entire webpage an application that doesn't rely on a browser like an applet or something if you don't want anyone to be able to access any of your source code.
deadserious is offline  
Old 08-10-2003, 01:04 PM THREAD STARTER               #4 (permalink)
NamePros Member
 
Mp)Tarh's Avatar
Join Date: Aug 2003
Location: Ontario, Canada
Posts: 98
Mp)Tarh is an unknown quantity at this point
 



Re: Best Way to Keep Source Hidden


Quote:
Originally posted by Mp)Tarh
????: NamePros.com http://www.namepros.com/showthread.php?t=15099
P.S this way is not foolproof, since data is stored on the clients computer in the temporary internet files folder, there is no true way to save your source code.
Just as I said above
__________________
Yeah... I knew that. What?
Mp)Tarh is offline  
Old 08-27-2003, 10:56 PM   #5 (permalink)
NamePros Member
Join Date: Aug 2003
Posts: 36
Tempest is an unknown quantity at this point
 



Your better off just stating that it is copyrighted in the top and bottom of the source code...

This will keep most people away, but as said above, if someone wants the code badly enough, they will take it anyways.
Tempest is offline  
Old 08-28-2003, 11:41 AM   #6 (permalink)
NamePros Member
Join Date: Jun 2003
Posts: 103
Fallout_Multi. is an unknown quantity at this point
 



kinda off topic, but can you see the php code in the temp folder or wherever that stuff is stored?
__________________
http://www.falloutweb.com
Fallout_Multi. is offline  
Old 08-28-2003, 11:56 AM   #7 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



I'm not quite sure what you're saying, but you can't see the php code via your browser, however you can see it if you have access to view the actual files on the server side via ftp etc...
deadserious is offline  
Old 08-28-2003, 04:58 PM   #8 (permalink)
NamePros Regular
Join Date: Jun 2003
Location: California
Posts: 245
Alpha is an unknown quantity at this point
 



Yeah PHP is serverside. It is executed and closed before it even gets to your browser.
__________________
--Alpha
Alpha is offline  
Old 09-01-2003, 11:12 PM   #9 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 117
pistol is an unknown quantity at this point
 



back to the source code hiding, i feel, personally, that that is dirty. afterall, me, you, and your best friend barry all learned from source, and there's nothing really all that important in the source itself.

you can grab the html, javascript, css, and photos and little more. of any of these, the only one that i can find even a remote reason to want to keep out of other people's hands is the photos. if you're that worried about them, put a watermark on them, your url in a noticeable place, and a copyright. (even if you use a script to cover up your photos, there's always that pesky prnt scrn button.)

in closing, my icons still rock the casbah: :crabby: :angry: :confused2 :webdev:
pistol is offline  
Old 10-31-2003, 11:18 AM   #10 (permalink)
NamePros Member
Join Date: Oct 2003
Posts: 134
insomnia is an unknown quantity at this point
 



I accually encourage people to veiw my source code. It makes a good tutorial. All my source code is free to the public. I don't know. I was born and raised to the tune of the gnu or whatever freesource linux has. I hold that to everything I do. Not sure why. But yea if someone does take my layout I might be a lil pissed. But if they use the graphis that's where I draw the line. Hotlinks are delt with by law, that's right, law. And then people who upload the images to their server should watch out. I'm working with a friend to build a program to seach for data that matches the data you want. oh yes... It will be ultimate.
????: NamePros.com http://www.namepros.com/showthread.php?t=15099

(so far the data search is in the lab being built, having trouble with making into a server app that anyone can run)
__________________
Can you tell ADD has OOO pretty butterfly!
insomnia is offline  
Old 12-22-2003, 04:35 AM   #11 (permalink)
RJ
NamePros Admin


 
RJ's Avatar
Join Date: Feb 2003
Posts: 12,919
RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness
 



Find Marrow Donors! Cystic Fibrosis Parkinson's Disease
Can you get this guy's source code?

http://www.drpeterjones.com/hidden/hidden.html
__________________
Reach me at rj at namepros dot com
RJ is offline  
Old 12-22-2003, 04:50 AM   #12 (permalink)
New Member
Join Date: Dec 2003
Posts: 20
CatsEyeDesigns is an unknown quantity at this point
 



Yeah, I sure can. Here's a quick tip.... clear your browser cache. Reload a page, open the browser cache, and open the file you want to look at. Takes about 30 seconds. There is no way to "protect your html/javascript sourcecode" aside from irritating people.
????: NamePros.com http://www.namepros.com/showthread.php?t=15099

And from a usability standpoint, you should never try to block the right click of a browser. That has got to be the biggest waste of time. I right click for a number of things on different webpages and when I see that stupid little popup that says "Copyrighted" or whatever, that usually only makes me want to take it even though I originally just right clicked to print an article, or open a new window or something.

Just my 2 cents.
__________________
Regards,
Ryan Burley
Lead Designer -CatsEyeDesigns.Net
CatsEyeDesigns is offline  
Old 12-22-2003, 05:14 AM   #13 (permalink)
RJ
NamePros Admin


 
RJ's Avatar
Join Date: Feb 2003
Posts: 12,919
RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness
 



Find Marrow Donors! Cystic Fibrosis Parkinson's Disease
Quote:
Originally posted by CatsEyeDesigns
Yeah, I sure can. Here's a quick tip.... clear your browser cache. Reload a page, open the browser cache, and open the file you want to look at. Takes about 30 seconds. There is no way to "protect your html/javascript sourcecode" aside from irritating people.
Great tip. What about these programs that claim to encrypt your html or javascript?
__________________
Reach me at rj at namepros dot com
RJ is offline  
Old 12-22-2003, 05:25 AM   #14 (permalink)
New Member
Join Date: Dec 2003
Posts: 20
CatsEyeDesigns is an unknown quantity at this point
 



None of them REALLY encrypt anything because they include the encryption key in plain view for anyone with more than a fundamental knowledge of how a webpage works.

On another note, "encrypting" a webpage is dangerous because from what I've seen, it all relies on the uneccessary use of Javascript, which as you know, is disabled in 10-15% of all internet browsers. Prevent 1 out of 10 from being able to view your page so that you can prevent 1 out of 50 visitors from viewing your source code? Doesn't make any sense to me.
????: NamePros.com http://www.namepros.com/showthread.php?t=15099

If you've got something that private, or valuable, the internet (in general) is not the right medium to publish it in the first place.
__________________
Regards,
Ryan Burley
Lead Designer -CatsEyeDesigns.Net
CatsEyeDesigns is offline  
Old 12-30-2003, 03:47 PM   #15 (permalink)
Senior Member
 
Kodeking's Avatar
Join Date: Jun 2003
Location: Naperville Illinois
Posts: 1,786
Kodeking is just really niceKodeking is just really niceKodeking is just really niceKodeking is just really nice
 



If you don't want people to steal:

Make a flash website!
__________________
Quote:
Clan-Forums.com >> $30 BoardingForum.com >> $100
TalkWebHosting.com >> $200 AvoidChapter13.com >> $100
Send PM to make lesser offers on the above names.
Kodeking is offline  
Old 12-30-2003, 03:50 PM   #16 (permalink)
RJ
NamePros Admin


 
RJ's Avatar
Join Date: Feb 2003
Posts: 12,919
RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness
 



Find Marrow Donors! Cystic Fibrosis Parkinson's Disease
Quote:
Originally posted by Kodeking
????: NamePros.com http://www.namepros.com/showthread.php?t=15099
If you don't want people to steal:

Make a flash website!
What about this now?

http://www.webdesigntalk.net/showthr...threadid=15801
__________________
Reach me at rj at namepros dot com
RJ is offline  
Old 02-06-2004, 03:41 PM   #17 (permalink)
NamePros Expert
 
Anthony's Avatar
Join Date: Dec 2003
Location: NYC
Posts: 9,132
Anthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant future
 

Member of the Month
October 2004

Yeah, there are multiple Flash ripping programs out there now, as well.
Anthony is offline  
Old 02-22-2004, 10:49 PM   #18 (permalink)
Account Closed
Join Date: Feb 2004
Location: Bothell, Wa
Posts: 237
Zero-Life is an unknown quantity at this point
 



Quote:
Originally posted by crEA-tEch
unless you use php scripts =)
uhhhhh, php codes are already hidden.
Zero-Life is offline  
Old 02-22-2004, 11:37 PM   #19 (permalink)
NamePros Regular
 
nicholas's Avatar
Join Date: Dec 2003
Location: The Beach
Posts: 584
nicholas is a glorious beacon of lightnicholas is a glorious beacon of lightnicholas is a glorious beacon of lightnicholas is a glorious beacon of lightnicholas is a glorious beacon of lightnicholas is a glorious beacon of lightnicholas is a glorious beacon of lightnicholas is a glorious beacon of light
 



there are many flash rippers/decoders out there already, some you can even get off sourceforge with ease.

Best way is to just obfuscate your code to give whoever's reading a hard time

But it'd probably be best to just let the source code be. As mentioned above, it may not really be a bad thing at all for people to see your source code. And if you really needed to hide it, the above methods would be good enough; although if you're dealing with more savvy users, there's no point in going through the trouble. Maybe just swallow hard and share it.
__________________
Newsback.com -- Commentary and backstories of the news
-----------------------------------------------
nicholas is offline  
Old 03-17-2004, 01:05 PM   #20 (permalink)
NamePros Regular
 
rabid_nerd's Avatar
Join Date: Feb 2004
Location: Meadville
Posts: 640
rabid_nerd is a jewel in the roughrabid_nerd is a jewel in the roughrabid_nerd is a jewel in the rough
 




My favorite method du jour is to telnet to port 80

Code:
                               <!--

                                   Congratulations, you've found the source code
!

 Your mind is sharp. Your virtual limbs are strong. You've
                                                           attained a measure of
 wisdom to be able to solve this puzzle,
                                        my friend. You are now ready to hear wha
t I have to tell you.
                      You must tread the path of foolishness to become wise. The

 foolishness of hiding source code teaches a lesson of
                                                       futility. To gleefully fl
ail against the inevitable, to put
                                   aside the fact that File>Save Page As... defe
ats even the
             most cunning design with a simple stroke of the digital
                                                                     blade, is t
o face a a brick wall and pretend to beat your
                                               head against it, and when you're
done, to have learned all
                          the same lessons that you would have learned if you re
ally
     had beat your head against it, but without the discomfort and
                                                                   embarassment
of it all.

          Some tips for the road:

                                   1. To go directly to the source code of any w
eb URL,
             type the URL preceded by view-source: For example
                                                                    view-source:
http://www.drpeterjones.com/
                              2. To discourage viewing of your JavaScript, place
     it in an external .js file and load it into the
                                                         page with the <script s
rc=""> method.
                3. One way for artists or photographers to discourage
                                                                           their
 copyrighted images from being saved is to
                                                embed the images in Flash. Remem
ber, it will only
                      discourage, not prevent.
                                                4. As mentioned above, File > Sa
ve Page As... will
                       Grab the source and any associated files of a web
                                                                              pa
ge and save the files to disk for easy viewing.

                                               -->

                                                  <html><head><title></title>

                                                                             <!-
- it redirects if you turn off JavaScript -->
                                             <noscript><meta http-equiv="refresh
" content="0;url=p.html"></noscript>

                                    <!-- you can't look at just this page. it al
ways jumps to frameset -->
                          <script language="javascript"><!--
                                                            if (top.frames.lengt
h == 0) top.location = "hidden.html";
                                     //--></script>

                                                   <style type="text/css"><!--
                                                                              /*
 'glass' is an image that layers over top of the doc,
                                                      giving the wrong context m
enu in some browsers. */
                        #glass{position:absolute;left:0;top:0;}


                                                               .big{font-size:70
pt;font-weight:bold;}
                     body{font-size:17pt;}
                                          --></style></head><body       bgcolor=
"#000000" text="#ffffff" link="#0000FF" alink="#FFFF00" vlink="#999999" topmargi
n="10" leftmargin="10" marginheight="10" marginwidth="10">
                                                          <script language="java
script"><!--

            // no explanation needed
                                    function disable_right_click(e) {
                                                                     var browser
 = navigator.appName.substring (0,9);
                                     var event_number = 0;
                                                          if (browser=="Microsof
t") event_number = event.button;
                                else if (browser=="Netscape")
                                                             event_number = e.wh
ich;
    if ( event_number==2 || event_number==3 )
                                             { alert ("Please..."); return (fals
e); }
     return (true);
                   }

                    // sniffs for key that activates context menus
                                                                  function check
_mousekey() {
             var mouse_key = 93;
                                var keycode = event.keyCode;
                                                            if ( keycode == mous
e_key )
       alert ( "Well, well... looks like somebody did their homework." );
                                                                         }

                                                                          // sel
f explanatory
             function trap_page_mouse_key_events() {
                                                    var browser = navigator.appN
ame.substring ( 0, 9 );
                       document.onmousedown = disable_right_click;
                                                                  if ( browser =
= "Microsoft" )
               document.onkeydown = check_mousekey;
                                                   else if ( browser == "Netscap
e" )
    document.captureEvents( Event.MOUSEDOWN );
                                              }

                                               // self explanatory
                                                                  window.onload
= trap_page_mouse_key_events;

                             // resizes glass.gif to cover entire screen
                                                                        if (docu
ment.body.clientWidth) {
                        var xxx = document.body.clientWidth;
                                                            var yyy = document.b
ody.clientHeight;
                 }
                  else if (window.innerWidth) {
                                               var xxx = window.innerWidth;
                                                                           var y
yy = window.innerHeight;
                        }
                         else {
                               var xxx = 2000;
                                              var yyy = 2000;
                                                             }
                                                              if (xxx < 481) xxx
 = 481;
       if (xxx < 292) xxx = 292;
                                document.write("<div id='glass'><img src='glass.
gif' width='" + xxx + "' height='" + yyy + "'></div>");
                                                       function relode() { locat
ion.reload(); }
               window.onresize = relode;

                                        // yet another event handler
                                                                    document.onc
ontextmenu = function() { return false; }

                                         //--></script>

                                                       <!-- actual page content
-->
   <font color="#ffffff">
                         <br><br><br>
                                     <div align="center">
                                                         <div class="big">Try to
 get it!</div>
              <br><br><b>
                         Snag that pesky source code.
                                                     </b>
                                                         </div>
                                                               </font>

                                                                      </body>
                                                                             </h
tml>
rabid_nerd is online now  
Old 03-17-2004, 09:27 PM   #21 (permalink)
NamePros Expert
 
Anthony's Avatar
Join Date: Dec 2003
Location: NYC
Posts: 9,132
Anthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant future
 

Member of the Month
October 2004

Well, at least I learned something from this thread -- that view-source:http://www.whatever.com/ thing is useful in IE!
Anthony is offline  
Old 03-30-2004, 09:25 PM   #22 (permalink)
NamePros Member
Join Date: Nov 2003
Posts: 29
aptimass is an unknown quantity at this point
 



Thanks for wasting my time RJ



the hidden message was:

THE CAT SCREAMS AT MIDNIGHT
aptimass is offline  
Old 09-30-2004, 05:21 AM   #23 (permalink)
NamePros Regular
Join Date: Sep 2004
Location: Poland
Posts: 245
Michau is on a distinguished road
 



The view-source: trick works in Netscape as well... Wow!!!
Michau is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:25 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger