Protect DLL from use in projects other than my own

I am going to create a large project and want to create several libraries (DLLs) for it. I do not want to combine them all in one EXE, but I want to use separate DLL files.

I do not want these DLLs to be used by others, so these DLLs must be protected so that they can only be used in my own project.

I was thinking of using some kind of password in the New () module, but this does not work for general classes.

Another solution I was thinking about: is it possible to check if the calling assembly has the same strong name as the DLL?

These solutions are just one of my ideas. I do not know if they will work, and I do not say that one of them is the way.

What is the best approach to achieve this?

BTW: I also use an obfuscator to protect my code.

+6
source share
2 answers

You can look at System.ComponentModel.LicenseProvider . You can use any authentication method that you want to check if they have a valid copy of the dll.

+4
source
Dim E.dll.Com.proc.ecription.pass = "0.0.13",bit If user.intrude.falsepasscode then process.break (intrude,process) Use.facilitator 0.492 End if If 029302 = 029302 Then Returnt.kill.me.process msgbox("Var dll cannot be used because its protected for sole use in VBEXplor.exe") 

Paste this code into the dll while editing the code and it should work!

-1
source

Source: https://habr.com/ru/post/885892/


All Articles