Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

* URGENT * Security issues on DLL

Status
Not open for further replies.

TipGiver

Programmer
Sep 1, 2005
1,863
Hello,

How can i ensure that my DLLs are only used by a certain application? Can i prevent the end user of adding a reference to his project and use them?
 
I've never heard of explicitly blocking other people from using them. I would imagine you could set something up in the constructor that looks for a specific value or else it won't work.
 
I have not sone this myself but I'd have a look at InternalsVisibleToAttribute.
As I understand it you would typically change all your public types to Friend types and at the assembly level specify which other assemblies may see the internal types of the assembly.

Or, you could use the StrongNameIdentityPermissionAttribute, which you would then have to apply to all types individually (i.e. not assembly global).

Please post back and let us know how you do.
 
You can embed a secret key in the DLL that callers must pass, but someone who wants it bad enough can reverse-engineer the DLL and discover it.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
@ chiph: I have purchased a program to prevent the disassembling + it has string encryption. One of my dlls has 4 controls that i dragged onto the main form (exe). What should i do there ?? Is it possible, at the controls' load method to get the "parent's" tag property (i'll have there the key)?
One other thought is :System.ComponentModel.Licence namespace but have not tried that.

(If it matters, Com visible, com class and serializable attributes are set to false).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top