views:

53

answers:

2

Hi,

I have written a POS application, and now i want to create different versions of it. Something like a basic version, a premium version and a Full version. So if a client pays more they get more features in the same application. Is it possible that i could keep one standard application but features in my application get enabled / disabled depending upon what license key user enters. Restrict parts of code that can be executed only if a certain key was entered.

Any ideas guys...

+2  A: 

There are many ways to do this, all of them breakable if skilled people are willing to put the time into it ;-) However, depending on the solution you choose, it will require progressively more work in your end, so be realistic and choose wisely.

For the actual license key, I highly recommend that you generate it using a standard public-private key encryption scheme such as rsa. That is, you create a license key text string that contains the name of the user (so you can track illegally shared license keys) and information about which code should be active. Encrypt the license on your end using the private key and distribute the app with the public key included. When the app starts, you read the license key and decrypt it using the public key. This will make it virtually impossible for people to modify or generate fake keys.

Now for the actual activation of code, here are two options I have used in production code: either simply include flags in the license key saying which parts of the code should be active and activate it using basic if then statements. Alternatively, depending on your programming language, you can dynamically load pieces of code from the license key making those parts of the code unusable without a proper key file (I did this in java with a custom class loader).... however, this last solution requires much much more work than the first, so think things through before you start designing your solution.

kasperjj
A: 

Sounds like something that would be readily and securely accomplished by a commercial license manager. If you do consider buying a working, tested solution rather than starting your own project, I'd hope you'd consider our EasyLicenser license manager, which allows you to configure as many product features as you wish, each with its own parameter. For example, what you described could be managed as a Version option with possible values Basic, Premium and Full, or you could control many features individually. You can also issue trial licenses, subscription licenses and so forth.

Dominic

Dominic