?
Solved

Encrypting ASP files

Posted on 2003-03-24
30
Medium Priority
?
313 Views
Last Modified: 2012-05-04
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.  
0
Comment
Question by:Vishal_m
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
  • 5
  • +4
30 Comments
 

Expert Comment

by:pat333
ID: 8194667
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
 

Expert Comment

by:pat333
ID: 8194716
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Expert Comment

by:pat333
ID: 8194927
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
 
LVL 18

Expert Comment

by:mgfranz
ID: 8195605
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
 
LVL 34

Expert Comment

by:arbert
ID: 8196331
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
 
LVL 18

Expert Comment

by:mgfranz
ID: 8196359
[spellcheck]...

The best way is to create .dll files out of the code
0
 
LVL 1

Expert Comment

by:MAXMASTER
ID: 8196688
how do you call dll from asp?
0
 
LVL 34

Expert Comment

by:arbert
ID: 8196714
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
 
LVL 18

Accepted Solution

by:
mgfranz earned 1000 total points
ID: 8196744
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
 
LVL 18

Expert Comment

by:mgfranz
ID: 8196750
Forgot the function to EnCrypt call;

objEncryption.EnCrypt()
          Response.Write "<b>Encrypted Text</b>: " & objEncryption.Encryption & "<br>"
0
 
LVL 1

Expert Comment

by:MAXMASTER
ID: 8197028
do you have to register the dll?
0
 
LVL 34

Expert Comment

by:arbert
ID: 8197067
Yes...
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 8197298
Well... that depends, certain .dll's are packaged as non-registering objects, C++ has this abiliy, not sure about VB.
0
 
LVL 34

Expert Comment

by:arbert
ID: 8197412
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
 
LVL 18

Expert Comment

by:mgfranz
ID: 8197444
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
 
LVL 12

Expert Comment

by:Wouter Boevink
ID: 8200981
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
 
LVL 18

Expert Comment

by:mgfranz
ID: 8202594
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
 
LVL 12

Expert Comment

by:Wouter Boevink
ID: 8203541
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
 
LVL 1

Expert Comment

by:MAXMASTER
ID: 8204252
Im really interested with this asp calling dll can you someone please give me a full code on how to do this

thanks
0
 
LVL 34

Expert Comment

by:arbert
ID: 8204389
Maxmaster, the code was already posted above....

0
 
LVL 1

Expert Comment

by:MAXMASTER
ID: 8204998

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
 
LVL 18

Expert Comment

by:mgfranz
ID: 8205073
Hey Max, why don't you post a seperate Q to get this answered?
0
 
LVL 1

Expert Comment

by:MAXMASTER
ID: 8205099

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
 
LVL 34

Expert Comment

by:arbert
ID: 8205780
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
 

Author Comment

by:Vishal_m
ID: 8208010
Does anyone have an idea about the HTML Guardian software from Protware? How effective is it?
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 8210726
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
 

Author Comment

by:Vishal_m
ID: 8215486
In addition it also encrypts .asp files and other client/server side scripts.
0
 
LVL 34

Expert Comment

by:arbert
ID: 8711649
What's up with this question???
0
 
LVL 58

Expert Comment

by:Gary
ID: 9313091
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question