Question

Can ASP source code be "hidden"?

Asked by: gglover

Is there a way to "hide" ASP code that's used on a web site?  I've heard that .NET will compile the code, which would accomplish it, but I don't really know where to start.  

Thanks -

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2001-09-04 at 16:35:04ID20178511
Tags

asp

,

source

Topic

Active Server Pages (ASP)

Participating Experts
6
Points
100
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Hiding checkboxes on asp form
    I want to hide some checkboxes on my asp page. I know the property in Visual Basic to do this is (visible = false)what is the equivalent in asp
  2. Hiding .asp files
    How can i hide my .asp file if i want to install my application to the client's PC.
  3. Hide ASP or JSP code
    Hello, is there a way to hide the code in the case of asp or jsp? (the web server runs locally) thanks
  4. ASP in JavaScript
    Hi, I have javascript function in the <script> block in an asp page, i want to write some ASP code in this function, and once i call this function from a submit button, it will go through the javascript function and execute the ASP code ? What i mean is to put ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: AzraSoundPosted on 2001-09-04 at 16:55:46ID: 6455014

If youre concerned about visitors to your page, you are fine, so long as you havent done anything to allow your code to be viewed (such as script errors in an include file with *.inc extension)

If you mean you want to protect it from someone you are distributing it to, or from the company hosting your site, then you need to wrap up the "sensitive" code into components (e.g., ActiveX DLLs)

 

by: ggloverPosted on 2001-09-04 at 18:32:48ID: 6455170

Right - the server is not in my area and I'm not sure who has access to what, but I'd just as soon not expose how we did every little thing.

We can go the ActiveX components, but doesn't that require that the user machine have updated system files (MDAC, DCOM, etc.)?  Seems like it would introduce a whole new array of things that could screw up.  Perhaps it's not that big a deal...

 

by: mgfranzPosted on 2001-09-04 at 20:28:59ID: 6455442

Microsoft has a script encoder available, http://www.microsoft.com/mind/0899/scriptengine/scriptengine.htm that will encrypt your code.

 

by: NathanCPosted on 2001-09-04 at 20:47:22ID: 6455478

The only way (now) to keep code secure in an environment that is not completely your own is to wrap it in dlls.

"System files" are not really a concern because server.createobject() instantiates the same dll that the activeX component you created will.  IIS is the "user machine".  You are right, dll's do bring a whole new thing- for instance, any time you update a dll you need to bring down IIS, replace the dll and the start IIS and w3svc again.

A service provider typically will not allow you to register "Home Grown" dll's.  So look very carefully at the contract, place copyright notices in your asp code- as both server side comments and javascript/client side comments-And talk to a lawyer.  Another option- find a "server host" rather than a "site host".  In other words place your own server, with your security at someone else's site.  If you are distributing asp code to clients- again notch up the license agreement, hire a lawyer, or dictate dll usage.

I'm not sure I really understand what you are after- just offering a few things I've encountered- doing both dll in an IIS environment and asp.

 

by: AzraSoundPosted on 2001-09-04 at 20:56:36ID: 6455489

Generally, it usually means that the server simply allows you to install custom components.  Other than that, you should run into few problems as long as you maintain versioning within your compononents.  If your host provides support for custom components, they will do the installation and registering of those components for you.

MS Script Encoder is not a solid solution.  Just do a search on the web for the MS Script Decoder and youll find plenty of links.

 

by: mgfranzPosted on 2001-09-05 at 07:39:08ID: 6457337

Azra, I'm suprised you say Script Encoder is not a solid solution, while it can be hacked, [what code can't], I encode lots of my scripts with it.  Just as a test, I have a simple date.asp file that I encrypted with MS Script Encoder.  Here is the code before encrypting;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
     <title>Date.asp</title>
<style>
body {
     font-family : Arial;
     }
</style>
</head>

<body>
Today is <%=FormatDateTime(Date(),2)%><p>
Todays date and time is <%=Now()%>.


</body>
</html>

Here it is after encrypting;

<%@ LANGUAGE = VBScript.Encode %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
     <title>Date.asp</title>
<style>
body {
     font-family : Arial;
     }
</style>
</head>

<body>
Today is <%=#@~^GAAAAA==oKDhmYGlYKbh+vfCY`bSy#9AcAAA==^#~@%><p>
Todays date and time is <%=#@~^BQAAAA==HKhc*hQEAAA==^#~@%>.


</body>
</html>

And here is the .asp page after running it through a "MS Script Decoder" I found on the web.

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Wed, 05 Sep 2001 14:39:24 GMT
Connection: Keep-Alive
Content-Length: 272
Content-Type: text/html
Set-Cookie: ASPSESSIONIDGGGGGKSQ=PCLDGJBDNOJCDMLJPLFDKDMP; path=/
Cache-control: private


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Date.asp</title>
<style>
body {
font-family : Arial;
}
</style>
</head>

<body>
Today is 9/5/2001<p>
Todays date and time is 9/5/2001 7:39:24 AM.


</body>
</html>

Looks pretty secure and safe to me...  while I agree registering a .dll is probably the safest way, the Script Encoder is fine for most needs.

 

by: AzraSoundPosted on 2001-09-05 at 08:00:21ID: 6457434

If he is that concerned with securing his scripts, I am just saying that he probably wouldnt want to rely on using something that has been hacked and posted all over the internet.  Of course, if his site host is that sneaky and devious, then he probably needs to find a new home elsewhere on the web anyways.

 

by: ggloverPosted on 2001-09-10 at 17:22:39ID: 6472764

Sorry for the delay.  After looking into it a bit, it does seem that the encoder will do just that, and is a quick and easy way to encode the ASP.  It also seems, however, that it's about as quick to "un-encode" it.  It's apparently been around without being changed, as well, which surely cuts down on its effectiveness.

My original question centered on .NET's "compiling" capabilities, but none of the answers mention it, so if it exists, it must not be very well known.

I think the suggestion of "wrapping in DLLs" might be a good one, but is there a source of how to do this?  Are these DLLs registered on the server only, or do they have to be registered on the user machine as well?

 

by: AzraSoundPosted on 2001-09-10 at 17:34:35ID: 6472781

>>My original question centered on .NET's "compiling" capabilities, but none of the answers mention it

Mainly do the fact that its still in BETA mode, and wont see full release til sometime next year, at least.  Then, we get to enjoy the road of new versions and service packs that developers enjoyed with Visual Studio.

Yes, ASP.NET will be coded in any language targeting the .NET platform.  VBScript is not one of those languages.  You will be using VB, C++, C#, etc, when writing your asp pages.  The benefit is compiled code, instead of interpreted code at run-time.  Yes the code is compiled, but its not hidden.  Your worries lie in the fact that someone can see your code.  This will not change in ASP.NET.  Your code is still visible to those who view your pages.  The difference is how your pages are executed under the .NET platform.  To "hide" your code, you still need to use a component, which, actually, may be even less "safe" under .NET because, currently, the .NET platform offers a decompiler tool that will generate IL code from compiled sources.


Wrapping up ASP code into an ActiveX DLL is not a difficult task, especially if youve coded in VBScript (most of the code can be copied/pasted into a VB component.  These components need only be registered on the server, where they are utilized, and not on the client machine.

 

by: mgfranzPosted on 2001-09-10 at 17:50:06ID: 6472801

I have not found a component, .exe or COM that can "un-encode" a MS Encoded .asp file, if you do know of a utility I would be happy to hear about it.

I still feel it's fine for most applications.

 

by: AzraSoundPosted on 2001-09-10 at 18:32:58ID: 6472866

 

by: mgfranzPosted on 2001-09-11 at 08:21:21ID: 6474788

Cool, thanks.  But the utility still requires the original .asp code.

I agree that wrapping the pages into a .dll or a .exe would be the ultimate solution, but it's seems senseless to have to re-compile just to fix a spelling or some other issue...

 

by: ggloverPosted on 2001-09-11 at 10:08:54ID: 6474948

Two viable alternatives... now all I have to do is write something worth hiding!
One more question - I guess I want to split the points; how is that done?
Thanks -

 

by: AzraSoundPosted on 2001-09-11 at 11:36:43ID: 6475068

>>But the utility still requires the original .asp code.

Thats what he has been worried about all along, e.g., a hosting site seeing his code.  Other than that, your server code is invisible to clients unless you have taken no steps to protect yourself.


>>but it's seems senseless to have to re-compile just to fix a spelling or some other issue.

Whether a component or script within an asp page, changes need to be made.  Hopefully, youve tested it before registering and putting it into use.  Even then, if changes are small, and youve compiled with binary compatibility, you can just copy over the old component with the new w/o any hassles of registering/unregistering.



To split points, just post a 0 pointer in Community Support, ask them to split the points, and link them to this question.

 

by: mgfranzPosted on 2001-09-11 at 12:17:56ID: 6475123

Azra, did you see the neat JS version?

If you dig hard enough at this site, you will find a Base64 encoding method that takes this basic page;

<title>Date.asp</title>
<style>
body {
font-family : Arial;
}
</style>
</head>
<body>
Today is 9/5/2001<p>
Todays date and time is 9/5/2001 7:39:24 AM.
</body>
</html>

And encodes it to this;

PGh0bWw+IA0KPGhlYWQ+IA0KPHRpdGxlPkRhdGUuYXNwPC90aXRsZT4gDQo8c3R5
bGU+IA0KYm9keSB7IA0KZm9udC1mYW1pbHkgOiBBcmlhbDsgDQp9IA0KPC9zdHls
ZT4gDQo8L2hlYWQ+IA0KPGJvZHk+IA0KVG9kYXkgaXMgOS81LzIwMDE8cD4gDQpU
b2RheXMgZGF0ZSBhbmQgdGltZSBpcyA5LzUvMjAwMSA3OjM5OjI0IEFNLiANCjwv
Ym9keT4gDQo8L2h0bWw+DQoNCg==

The only caveat is that the decoder will have to be declared or included in an encrypted page, or better yet, wrap the decoder into a .class file... ;-)

[I love my the net...]

 

by: ComTechPosted on 2001-09-16 at 04:51:35ID: 6485606

Hi mgfranz, you feft a link and a request to split points, for the record, would you please return to that question and tell the Moderator Who you wat the split to go to?

Thank you,
ComTech
Community Support Moderator

 

by: mgfranzPosted on 2001-09-17 at 06:48:49ID: 6487555

Umm... ComTech, I think you want gglover to handle this request, not me.  ;-)

 

by: ComTechPosted on 2001-09-18 at 05:33:11ID: 6490293

Right.  The split will be as follows:

50=mgfranz
50=AzraSound

gglover, I will reduce you points by 50, and accept one qustion here.

Use the other 50 points and create a new question here in this Topic Area for the other Expert.  Entitile the question *Points for <Expert Name)*  In the Comment Box type *For your help in my question #20178511*  

Choose the 50 point button and submit, this will complete the split.

Thank you,
ComTech
Community Support Modeator

 

by: astaecPosted on 2002-04-10 at 09:59:38ID: 6931767

Hopefully you've already been helped with this question, but thought you'd appreciate knowing this.

WindowsUpdate has new updates for .NET users; Details follow - Microsoft .NET Framework
The .NET Framework is a new feature of Windows. Applications built using the .NET Framework are more reliable and secure. You need to install the .NET Framework only if you have software that requires it.

For more information about the .NET Framework, see http://www.microsoft.com/net. (This site is in English.)

System Requirements
The .NET Framework can be installed on the following operating systems:
Windows 98
Windows 98 Second Edition (SE)
Windows Millennium Edition (Windows Me)
Windows NT 4.0® (Workstation or Server) with Service Pack 6.0a
Windows 2000 with the latest service pack installed (Professional, Server, Datacenter Server, or Advanced Server)
Windows XP (Home Edition and Professional)
You must be running Internet Explorer version 5.01 or later for all installations of the .NET Framework.

To install the .NET Framework, your computer must meet or exceed the following software and hardware requirements:

Software requirements for server operating systems:
MDAC 2.6
Hardware requirements:
For computers running only a .NET Framework application, Pentium 90 mHz CPU with 32 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 mHz CPU with 128 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
Recomended software:
MDAC 2.7 is recommended.
Recommended hardware: For computers running only a .NET Framework application, Pentium 90 MHz CPU with 96 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 MHz CPU with 256 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.

How to use -> Restart your computer to complete the installation. No other action is required to run .NET Framework applications. If you are developing applications using the .NET Framework, you can use the command-line compilers or you can use a development environment, such as Visual Studio .NET, that supports using the .NET Framework.

How to uninstall
To uninstall the .NET Framework: Click Start, point to Settings, and then click Control Panel (In Windows XP, click Start and then click Control Panel.).
Click Add/Remove Programs.
Click Microsoft .NET Framework (English) v1.0.3705 and then click Change/Remove.
More here  http://www.microsoft.com/net/

The .NET topic is being considered for addition to our All Topics link soon, so this may interest you as well:
http://www.experts-exchange.com/newtopics/Q.20276589.html

EXPERTS POINTS are waiting to be claimed here:  http://www.experts-exchange.com/commspt/Q.20277028.html

":0)
Asta


 

by: lavinderPosted on 2003-06-26 at 04:57:30ID: 8804810

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split - azrasound mgfranz
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
lavinder
EE Cleanup Volunteer

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...