Question

I am a bit new to C# program language, I will like to know how to secure my C# desktop app from being redristibuted on various systems without my permission. I have seen some possible solutions but I will want your advice

  • Create a web activation system where a pin/unique code is issued before every install
  • Create an online install system that allows people to install directly from a website without downloading the setup

Please help advice on the best option to take(I'll love to use the first option if it is possible with php/mysql because I am not good with asp.net)

Was it helpful?

Solution

Well you can't instal a program without a setup file. You need some small setup file that would download the actual setup file from your setup, that is how I see most programs being installed.

Normally on a server you have options to download full setup file (big setup file that contains all the installation data) and online setup file (small file that requires internet connection during installation).

And it doesn't really mater do you use php or asp.net on your server, because the only thing that matters is what your script does on the server.

How your validation would work is that your setup file before installing your program would require the user to insert the validation key and it would send it to the server. Your php script will search the mysql table and if it finds that key it would tell your setup file that password is ok and it would mark that key as "used" in your mysql table. Otherwise the user would have to reenter the key.

OTHER TIPS

The answer to your question depends on the level of protection you would like to implement.

  1. The simplest one is just to implement a product key protection without any need for online activation: in this case the keys should be selected/validated by certain algorithm that you include in your program. It's not a really good protection because the same key might be used for multiple (theoretically infinite) product installations.

  2. More robust protection could be achieved with online product key activation. In this case you can specify the number of activations per key (e.g. 5), thus preventing the same key to be overused.

There are plenty of info in this regards addressing the practical aspects of such key protection.

Rgds, AB

You can do the following:

  1. After installing and starting the app, the app generates a user key based on physical system attributes like MAC Address/Serial No. etc.

  2. The user is prompted to enter the corresponding license key to activate the product.

  3. The user either using a web app or over phone or email, provides the user key and requests for corresponding license key.

  4. You will have some algorithm to generate unique licence key from user key which the app can validate.

  5. Upon receiving the licence key, the user enters the same in the app and starts using it.

Installing the app on a different machine changes the user key and the app will not work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top