Encrypting ASP files

I would like to know if there is a way to encrypt ASP files on the server (IIS) so that a user cannot access the source code.  
Vishal_mAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pat333Commented:
Do you mean a local user with access to the filesystem? It ought to be impossible for a user (remote or local) to access the source code through IIS.
0
pat333Commented:
Do you mean a local user with access to the filesystem? It ought to be impossible for a user (remote or local) to access the source code through IIS.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

pat333Commented:
Do you mean a local user with access to the filesystem? It ought to be impossible for a user (remote or local) to access the source code through IIS.
0
mgfranzCommented:
While the Microsoft Script Encoder is a nice tool, it can be beat and the code decoded simply enough.  http://www.virtualconspiracy.com/index.php?page=scrdec/intro&ref=

The best wat is to create .dll files out of the code.
0
arbertCommented:
Exactly, if you really have sensitive routines or users/passwords that you don't want anyone to see the best (but not foolproof) method is to put the functions into COM objects (using VB, C++, C#, etc) and then call the objects from your asp.

Brett
0
mgfranzCommented:
[spellcheck]...

The best way is to create .dll files out of the code
0
MAXMASTERCommented:
how do you call dll from asp?
0
arbertCommented:
Like this:

<%
Set adrot=Server.CreateObject("MSWC.AdRotator")
%>



That creates a reference to the built in adrotator function, but it's the same method for any DLL that you create and register.

Brett
0
mgfranzCommented:
Simple, once the .dll is created just call the functions;

Set objEncryption = Server.CreateObject("ASPEncryption.clsEncryption")
          Response.Write "<b>Text to Encrypt</b>: " & Request.Form("txtEncrypt") & "<br>"
     objEncryption.Encryption = Request.Form("txtEncrypt")

Class file;

Public Property Let Encryption(s As String)
    sEncryption = s
End Property

Public Property Get Encryption() As String
    Encryption = sEncryption
End Property

Public Function EnCrypt()
   
   Dim strByte, strCrypt, strClearText, i, j, A1, A2, A3 As Long
   strClearText = Encryption
   j = 1
   lsKey = Key
   
   For i = 1 To Len(strClearText)
     A1 = Asc(Mid(lsKey, j, 1))
     j = j + 1
     If j > Len(lsKey) Then j = 1
     A2 = Asc(Mid(strClearText, i, 1))
     A3 = A1 Xor A2
     strByte = Hex(A3)
     If Len(strByte) < 2 Then strByte = "0" & strByte
     strCrypt = strCrypt & strByte
   Next
   Encryption = strCrypt
   EnCrypt = strCrypt

End Function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgfranzCommented:
Forgot the function to EnCrypt call;

objEncryption.EnCrypt()
          Response.Write "<b>Encrypted Text</b>: " & objEncryption.Encryption & "<br>"
0
MAXMASTERCommented:
do you have to register the dll?
0
arbertCommented:
Yes...
0
mgfranzCommented:
Well... that depends, certain .dll's are packaged as non-registering objects, C++ has this abiliy, not sure about VB.
0
arbertCommented:
Ok, so how does ASP know how to get to the object if the dll isn't registered?????  I didn't know there were ways to use objects without at least one of the components being registered--example?

Brett
0
mgfranzCommented:
99% of any .dll created for use in an asp page must be registered so I wouldn't worry about the un-registered objects.
0
Wouter BoevinkMasterCommented:
Let's say a 100% of any .dll created for use in an asp page. To use a dll in asp you have to call server.createobject. To use server.createobject the dll has to be registered.
0
mgfranzCommented:
I ran into a C component the other day, can't remember where, but it was non-registering and ws called from a asp...

Anyway, that's not the issue here, we haven't heard from Vishal since day one...
0
Wouter BoevinkMasterCommented:
mqfranz, it's a pitty you don't know which component it was. I'm quiet curious, I didn't think it was possible for asp to call a non registered component.
0
MAXMASTERCommented:
Im really interested with this asp calling dll can you someone please give me a full code on how to do this

thanks
0
arbertCommented:
Maxmaster, the code was already posted above....

0
MAXMASTERCommented:

albert,

Here is the error when i try to run the code above

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed

can please tell me how to this properly thanks


0
mgfranzCommented:
Hey Max, why don't you post a seperate Q to get this answered?
0
MAXMASTERCommented:

albert,

Here is the error when i try to run the code above

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed

can please tell me how to this properly thanks


0
arbertCommented:
You probably get that error because you don't have that object on your machine!!!!  That was an example--you must have the DLL loaded and registered on the server to use it.

Brett
0
Vishal_mAuthor Commented:
Does anyone have an idea about the HTML Guardian software from Protware? How effective is it?
0
mgfranzCommented:
It's works fine, 99% of the general public will never be able to crack it.  But true hackers will be able to...

But I thought you wanted to encrypt them on the server?  All the HTML Guardian does is protect the output HTML code.
0
Vishal_mAuthor Commented:
In addition it also encrypts .asp files and other client/server side scripts.
0
arbertCommented:
What's up with this question???
0
GaryCommented:
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:

Accept Answer by mgfranz

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.