Search code examples
c#winformsencryptionanti-piracy

is there any good method to encrypt the C# desktop application


Possible Duplicate:
Protect .NET code from reverse engineering?

we just develop a application with C# winforms, is there any good encryption method to help us prevent from piracy ? I saw some software may need hardware support to protect their software, how to implement that ? Thanks in advance !


Solution

  • Okay, you are mixing up a few different concepts here.

    Encryption is geared towards keeping people out of your data.

    Obfuscation is used to try and prevent reverse engineering your code.

    Licensing is used to make sure the number of copies in use does not exceed the number purchased.


    You will want to research both obfuscation and software licensing. Obfuscation because you will want to prevent them from reverse engineering your licensing scheme to either duplicate it or simply bypass it.

    From a licensing perspective there are a number of different avenues. Hardware protection means that your app queries a dongle of some type to retrieve a valid key. If the dongle is present AND the key is good, then your app runs.

    Software licensing can be a bit more complicated. You'll generally have some type of phone home code which should send an encrypted version of the human readable / type-able key to your licensing server to verify it. You'll want to include some type of additional machine information (such as hard drive serial number) in order to make sure the key isn't being activated multiple times for different boxes.

    Sometimes the activation process downloads additional files to make the app run. I hope that gives you a start.