2

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)

3 Answers3

2

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.

zoran404
  • 1,682
  • 2
  • 20
  • 37
  • o and I want to add, the way you would generate the keys could be: on your site you could have them pay with peypal or do something else like register, then your php script would send them an email with the key and also add that key to your mysql table. – zoran404 Sep 08 '13 at 13:28
  • thanks a lot, this will work for me(authenticating with php/mysql), but one more question, please can you give me a hint how I can send information to my php site from the C# desktop application – Korede Lawrence Oluwafemi Sep 08 '13 at 14:10
  • Idk how this is done in c#, but this page seams to be about that http://stackoverflow.com/questions/2471209/how-to-read-a-file-from-internet . Basically you just use GET method to send data to the server and retrieve information. I would also advise that you don't try to make online installation setup, full setup file is simpler to make. P.S. You can accept my answer if it answers your questions. – zoran404 Sep 08 '13 at 16:16
0

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

Alexander Bell
  • 7,842
  • 3
  • 26
  • 42
0

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.

Vinod Kumar Y S
  • 628
  • 3
  • 9