 |
| ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 18th, 2010, 08:43 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Protect Javascript from being downloaded or encrypt it's code
Hello Friends,
Could anybody let me know how to Protect Javascript from being downloaded or encrypt it's code. Actually i'm using lot of javascript in my web application to speed up but it's code can easily be traced or downloaded so someone let me know how can i protect my javascript from either being downloaded or let me know how to encrypt it so that no one can use my js code
Last edited by Manoj Bisht; September 18th, 2010 at 08:47 AM..
|
|

September 18th, 2010, 11:34 AM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
|

September 22nd, 2010, 03:18 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
|
|
FYI, these are half measures though. Javascript is a client side technology so if it isn't sent to the client... it won't run, period. No exceptions. So your visitors HAVE to be able to download it or it won't run. There are some techniques for masking the script (replacing the code with entities, etc.) but again, by definition the browser has to be able to understand it so I wouldn't call any of these techniques encryption by any stretch of the imagination. If it were truly encrypted and secure, the browser couldn't read it and the script wouldn't run. So whatever you do to mask it, it's still quite easy for someone to reverse the process in the same way the browser does in order to gain access to it. This is a JS fact of life. If you want to keep your code away from your visitors, you HAVE to do the programming server side where visitors will receive the output from the programming and not the program itself.
__________________
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
|
|

September 22nd, 2010, 03:22 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
And as Joe said, years ago:
Quote:
|
And why is it that the people whose code is so revolutionary that it needs hiding are always the ones who don't know how to hide it :)
|
Imar
|
|

September 22nd, 2010, 11:27 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
|
|
ROFLMAO! OK, what's funny is not the quote (though it's great), or the four posts before it reaming on the guy trying to implement one of the most annoying practices ever introduced.
It's the guy who shows up at the end of the thread and asks....
Quote:
hello,
i'm also looking disable view source code, please anyone help me
|
 Dude... Seriously??? Try reading the thread before you post...
__________________
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
|
|
 |