BetaArchive Logo
Total Current Archive Size: 4765.54GB in 15409 files
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 10d, 14h, 25m | CPU: 13% | MEM: 5693MB of 12279MB used
{The community for beta collectors}

Forum rules


Before you post, please make sure...

- ...you have first used Google to look for an answer, and you have asked other people you know via other methods (IM, e-mail, etc).
- ...your question has not been asked before. Search the forum first before posting.

If you meet those criteria, go ahead and post your question. Be sure to provide as much information you can about the problem and how to recreate it. Also provide information on hardware and software if applicable.


Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 PostPost subject: A way of preventing people from viewing website source code?        Posted: Sat Jul 17, 2010 3:19 am 
1337 Beta Collector
1337 Beta Collector
Offline

Joined
Sat Oct 04, 2008 5:43 pm

Posts
1223

Location
Milky Way Galaxy

Favourite OS
Windows Server 2012 Dtc
Well, is there a way I can prevent users from seeing a javascript source I put into a page?

Thanks,

motherboardlove

_________________
See my profile for my website link.


Top  Profile  WWW
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Sat Jul 17, 2010 4:08 am 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Sun Jan 11, 2009 3:29 am

Posts
2314

Favourite OS
Maemo 5 PR1.3
Use a minifier/packer. Speeds up page load times and encrypts the code as a bonus.
Hinthint: With enough effort, you can still decrypt the JS.

_________________
Program run condition: collect keys. Deadline: 2 days.


Top  Profile
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Sat Jul 17, 2010 4:36 am 
Ex OSBA Member
Ex OSBA Member
User avatar
Offline

Joined
Sun Jan 27, 2008 8:09 pm

Posts
3991

Favourite OS
OS X 10.8
Don't you think this is a little counter-productive to the community?

_________________
Image
Image
Twitter


Top  Profile  WWW
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Sat Jul 17, 2010 6:06 am 
1337 Beta Collector
1337 Beta Collector
User avatar
Offline

Joined
Mon Mar 30, 2009 1:17 pm

Posts
1167

Location
Western Australia

Favourite OS
Windows Ultimate 7601 x64
Javascript is client side Scripting. (e.g. it is parsed by the clients browser.) You should look at a ifferent scripting language if it really needs to be hidden.

_________________
Looking for IT Helpdesk Software? I'm currently working on one aimed at small businesses and freelancers.
@BobGeorge33


Top  Profile  WWW
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Sat Jul 17, 2010 9:47 am 
Site Administrator
Site Administrator
User avatar
Offline

Joined
Fri Aug 18, 2006 11:47 am

Posts
11407

Location
Merseyside, United Kingdom

Favourite OS
Microsoft Windows 7 Ultimate x64
Its impossible to prevent it. No matter what you do it can always be decrypted given the browser has to do so to use it. Don't waste your time.

_________________
Image


Top  Profile  WWW
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Thu Apr 07, 2011 3:36 am 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Wed Apr 06, 2011 8:10 pm

Posts
25

Favourite OS
linux
We can see the page content by using a sniffer or a raw socket.
Don't wast your time


Top  Profile
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Tue Apr 12, 2011 5:50 pm 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Tue Apr 12, 2011 5:33 pm

Posts
10

Favourite OS
Windows
Same as above - if a browser can render it, it can be copied.


Top  Profile
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Wed Apr 13, 2011 1:14 am 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Wed Apr 13, 2011 1:06 am

Posts
10

Favourite OS
1900
As I recall, JavaScript is executed on the local machine, so you can't really hide it from the user. If you want to hide the script from the user, I would suggest PHP, ASP, or another server-side scripting language for the design.


Top  Profile
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Fri Apr 15, 2011 11:51 pm 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Fri Apr 15, 2011 11:32 pm

Posts
12

Favourite OS
6.1.7850.0 win8m1
PortalCake wrote:
Use a minifier/packer. Speeds up page load times and encrypts the code as a bonus.
Hinthint: With enough effort, you can still decrypt the JS.

This is going to be your best bet.

If you want something simpler that will only block simple attempts at your code, you could just dis-able right-clicking.


Top  Profile
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Sun Apr 17, 2011 8:50 pm 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Sun Apr 17, 2011 8:12 pm

Posts
44

Favourite OS
7601
joey23art wrote:
PortalCake wrote:
Use a minifier/packer. Speeds up page load times and encrypts the code as a bonus.
Hinthint: With enough effort, you can still decrypt the JS.

This is going to be your best bet.

If you want something simpler that will only block simple attempts at your code, you could just dis-able right-clicking.


Even if you were to disable right clicking, one could still view page source with Ctrl+U.


Top  Profile
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Wed Apr 27, 2011 6:32 pm 
Newbie Beta Collector
Newbie Beta Collector
Offline

Joined
Wed Apr 27, 2011 3:34 pm

Posts
3

Favourite OS
WinXP SP3
You can always make it slightly more difficult by doing BOTH, minifying/packing AND by storing the js in aseparate file and reference it from your pages, using, e.g.:

<script type="text/javascript" src="minified.js">


Top  Profile
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Fri Apr 29, 2011 8:41 pm 
Newbie Beta Collector
Newbie Beta Collector
User avatar
Offline

Joined
Fri Apr 29, 2011 7:50 pm

Posts
7

Location
localhost

Favourite OS
Windows XP Professional SP3
As others have said, I doubt that this is possible, as Javascript has to be rendered by the browser. A server-sided scripting language would be a good idea for this sort of thing.


Top  Profile  WWW
 PostPost subject: Re: A way of preventing people from viewing website source c        Posted: Sun May 01, 2011 6:59 am 
Amateur Beta Collector
Amateur Beta Collector
Offline

Joined
Sat Apr 16, 2011 7:48 pm

Posts
51

Favourite OS
7601
I am a web developer and I spent a month researching every facet of the concept for a client before I had to tell them it wasn't possible... If you made it 100% unreadable or uncrackable it would not load correctly in the browser... You can disguise it yes, but you can't hide it or encrypt it beyond simple tricks... It has to be able to be interpreted by the browser and if it can be read by browser it can be read by man... I can crack most filters or encryptions for both PHP and HTML/JS in about 10 minutes usually...

You can however create a PHP file that cannot be viewed without being called from one of your files.

_________________
Tools I Use: "Blackberry 9650, Windows 7 (7601) on Dell Inspiron 1525, iPod Touch 4"
Software: "Eclipse, Firefox, Apache, CentOS Server"


Top  Profile
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2013

 

Sitemap | XML | RSS