protect the unauthorized use of my DLL

0

Cordial greeting!

I have a solution in Visual Studio which has 3 projects:

  • MVC Web Project
  • Desktop Project (WinForms)
  • Project DLL: where it has the logic of the application.
  • Project 1 and project 2 refer to project 3 (the DLL) and consume the classes, methods and all contained in that DLL.

    As project 1 and 2 make reference, another person could take the same DLL and reference it in its own application, that is, use that dll.

    My question is how can I restrict the use of my DLL, even if referenced from another solution or project other than mine, that is, protect the unauthorized use of that .dll

    I appreciate if you can give me an example c #

    Thanks

        
    asked by Jorge 04.11.2017 в 17:52
    source

    1 answer

    0

    It all depends on how much time and effort you want to spend and how much you care to ensure that others do not use it. But francamene, it's a bad idea. In these times the development of software is more oriented to the open, and trying to close your software goes against all the ideals of that movement.

    That said, there are naive schemes that may be enough, like putting an initialization function that is called with an argument that is a key. Your software calls it with the correct argument, other people do not know it. And in that initialization, you set a global / static variable that all other functions check before doing anything. A kind of key / lock.

    Another more tedious option is that each function has an additional password parameter.

    There are more complex options, such as that the dll communicates with a web service with environment parameters, to see if it is authorized or not ... everything can become more and more complex.

        
    answered by 06.11.2017 в 13:45