Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

avoid dll from referencing

Hello all,
I am creating an application that interacts with the database via a dll. the dll also has other bussiness logics and encryption of data, implemented.
Since i will be distributing the dll with my application, there arise a need to know how do i avoid/stop my dll from being referenced by other projects.
Like for eg: if one tries reference any dll(pick any one randomly from the system32 folder), it will say "can't add a reference to the specific file". i want something like this, so that my logic remains protected in dll.
Any ways to go about it ??
Have a great day,
happy programming
Bhushan
0
bhushanp
Asked:
bhushanp
1 Solution
 
y2kswCommented:
1) Name it in a very specific way, not common to the 8.3 standard of most DLL's. No protection against other uses.

2) Put in the Class_Initialize event a procedure which goes and read a specific value from the registryor a specific file. If this is missing, do an Err.Raise 12345, for example, and the DLL cannot be loaded. This requires an installation procedure first. But this isn't standard programming and not very kindly to potentional new clients who'd like to look at your DLL's interface.

3) Insert an Init procedure and pass some parameters for activating the DLL functions. So people can develop with the DLL interface but cannot run the code. This way is ISO and used widely.

4) Use a software protector (like ASProtect) ==> professional protection, but some extra expenses and programming requirements.

Hope this helped :-)
0
 
HarmnKardnCommented:
If you want to be an uber-bastard, you could require all your client's computers to have net access, and the client developer machine make a socket connection with a simple registration server you write and admin yourself.  

You'll be able to monitor everyone who instantiates your COM objects online, even implement some form of authentication to let some users make some objects, other users no objects, etc.

However, this approach is painful and impractical.  Instead I'd recommend y2ksw's solution number 3) (the Init procedure).
0
 
webJoseCommented:
Just a note:  The specifics of "can't add a reference to the specific file" refer to the fact that the dll selected does not contain a valid type library embedded.  That is all.

As for your problem, I also vote for option 3) above, although you can always make the dll require licensing.  But again, I think VB is not capable of making use of runtime-only licensed dlls because it does not compile the license key for this particular type of COM houses.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
bhushanpAuthor Commented:
Hello all,
i worked on the option no. 3 posted by y2ksw and it worked just well as i needed.
Thanks for your response.
Bye
Best regards
Bhushan
0
 
bhushanpAuthor Commented:
Hello all,
i worked on the option no. 3 posted by y2ksw and it worked just well as i needed.
Thanks for your response.
Bye
Best regards
Bhushan
0
 
CleanupPingCommented:
bhushanp:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
y2kswCommented:
> Who deserves points here?

Me :-)
0
 
DanRollinsCommented:
Moderator, my recommended disposition is:

    Accept y2ksw's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now