Question: How can I create a product key for my C# Application?

I need to create a product (or license) key that I update annually. Additionally I need to create one for trial versions.

> 
> Related:
> 
> 
> * [How do I best obfuscate my C# product license verification code?](https://stackoverflow.com/questions/501988)
> * [How do you protect your software from illegal distribution?](https://stackoverflow.com/questions/109997)
> 
> 
>

Answer: 
The trick is to have an algorithm that only you know (such that it could be decoded at the other end). 

There are simple things like, "Pick a prime number and add a magic number to it"

More convoluted options such as using asymmetric encryption of a set of binary data (that could include a unique identifier, version numbers, etc) and distribute the encrypted data as the key.

Might also be worth reading the responses to [this question](https://stackoverflow.com/questions/404806/pin-generation#404904) as well
You can check [LicenseSpot](http://www.licensespot.com). It provides:

* Free Licensing Component
* Online Activation
* API to integrate your app and online store
* Serial number generation
* Revoke licenses
* Subscription Management