views:

200

answers:

6

Hi, this is my first question so please be gentle...

I am working on a software which I would like to protect using some kind of licensing scheme. A basic scheme would be to generate some "unique" key for a user. The user sends this key and a registration code when he wants to register the software and receives an activation code.

When the application runs it validates the activation code by comparing the "unique" key and a datablob received by decrypting the activation code.

This is fair and quite simple to implement, one can choose different crypto algorithms etc. however this scheme lacks two properties:

  1. If the user manages to spoof hardware signature etc. to produce the same "unique" key on another computer he could use the same license data.
  2. If the user decides to uninstall the application and wants to move it to another computer, there is nothing that prevents him from using the old license data again at the old computer and still obtaining new license data for the new installation.

Do you have any suggestions on how to resolve these issues?

One idea I had was to add some random data to the "unique" key, this random data would be stored in an obscure way, if the user deinstalls the application this random data would be removed, and some kind of hash with the previous random data and the license data would be generated which could be sent to me to verify that he really have uninstalled the application and made me sure that he wont be able to use the previous license data again since the random data had changed.

Over and out, for now...

EDIT: I currently have a scheme that works, I should mention that the most common product is installed in an embedded enviroment where hardware-changes are very rare and if there is a hardware failure then most certain the machine is broken. But I could modify the hardware-key scheme to take into account and allow for some changes.

Also because of this the software will most likely not be run inside a VM, good point though and I haven't thought about that.

The application does not call out regularly, if a network connection is available the user gets the option to make a more automatic registration, otherwise he/she gets a registration key, enters it in the software and gets an installation ID which is provided to me, registration code + installation ID generates an activation key that the user gets from me which then unlocks the software.

What I am looking for is good/feasible solutions to the 2 points. Hardware spoofing, Revoking license keys i.e. to be sure the user can not use the same regcode+activationcode.

Thank you for all your feedback

It is not necessary to

A: 

Why develop your own when there are well-proven licensing systems already out there? This is discussed in more detail in an article (I recently wrote) on Six Issues to Consider before Building Your Own License Manager.

Dominic

Dominic
Your comment is appreciated, but keep it as a comment and not an answer please.
Daniel Persson
@Daniel: while Dominic's advertising is perhaps not in good taste, the point is valid: if you need to ask, whatever you come up with is going to cost you more than it's worth.
Gilles
Yes it is valid, and as I wrote I appreciated the reading, however one big problem is that I dont think any of of-the-shelf libraries supports the systems I require them to support.
Daniel Persson
Credibility of information is damaged by the number of links placed to a single vendor's product.
Joe Koberg
+3  A: 

First, you should make it clear what you're trying to protect. Apparently, you want to ensure that for each purchase of your application, there will only ever be one computer on which the application is installed and runnable.

You propose to use a hardware signature as part of each user's unique key. What happens if my hardware fails (e.g. my hard disk breaks)? I'm certainly not going to purchase your application if I can't go on using it after a hardware problem, so at a minimum you must be prepared to handle key change requests. You'd better respond fast, because if your application is important I want to minimize downtime. And I'm not inviting you to check that my hardware has failed, so you'll have to take my word for it. That means any user can get a free licenses from time to time by pretexting a hardware failure.

What about virtual machines? It's probably feasible to detect all currently existing virtual machine configuration, at the risk of a few false positives now and then. If you forbid virtual machines, how do you justify this to users? If you allow virtual machines, how do you prevent the user from making multiple copies of the whole VM? (This can happen even with physical machines, with hibernation).

Is the application going to call back to you every time it starts? I guess so, from your deinstallation scheme. That's a bandwidth and availabilty cost, and will also put off some users — not everyone is online, especially in sensitive environments. But then you don't need such a complex scheme: your server can keep track of how many copies of the application are running, though you do have to handle the case when the application doesn't terminate cleanly for any reason (application crash, OS crash, power failure, loss of connectivity...).

You don't discuss this in your question, but you have to protect the application executable, so that someone can't bypass the license check with a debugger.

Gilles
I have added some additional information to the question. I didnt cover debugger/decompiler for some reason... I have some things to protect against those kinds of attack. Not very strong but anyways.
Daniel Persson
+1  A: 

Let the registration code also be the activation code.

You generate the unique registration code at point of sale, or packaged with the product. Customer registers/activates/deactivates with you (or your server) in one step using that single code. The customer's hardware doesn't have to generate any keys.

Reregistering/reactivating still requires contact with you, so you're aware of reinstall attempts.

joe snyder
ok, so what if this customers give out the registration code to another person? Since all software should be able to be registered offline I can not verify the validity of the registration code only.That is why the registration process is a two step procedure now, where the user enters the registration code and then gets an installation id which I receive (over tcp/ip, telephone etc...) from those two pices of information I generate the activation key which now is tied to that device.
Daniel Persson
@Daniel: Since you're requiring activation, there's no reason for a separate registration step, nor for offline registration. That just complicates everything. Keep it simple. Provide a single code to register and activate with u all at the same time. If the customer gives the code to someone else after registering/activating, the new user can't register/activate with the same code because u already know it belongs to the first customer. Eg, code A1B2C3 ships with product, user or program sends code to u to register/activate (along with name/address/MAC/whatever else u want to capture).
joe snyder
+1  A: 

Place your software into appliance hardware and put a padlock on the hardware. Ship the appliance to the customer.

If you believe the customer will hacksaw the appliance open to get your code, consider encrypting the storage medium.... Then they have to hacksaw the box AND find the keys. A TPM chip or secure USB token may aid with the latter.

Joe Koberg
A: 

I think that the only solution to your problem is a cryptographic hardware dongle. Usually it would be a USB-based tamper-resistant challenge-response dongle, that can be easily transferred between computers.

These devices cost less than $1 for large quantities, and not more than $10 for very small quantities. The good ones are very hard to forge, very easy to embed in your application, and usually supplied with a free EXE encryptor which also contains anti-debugging and anti-reverse-engineering functionality.

Lior Kogan
A: 

Being a shareware author and longtime member of ASP myself i think you are going into the wrong direction with your solution. The only way to make this workable is with a hardware device as already suggested. This or constant online activations is the only way if you want to be sure and your product is so good and without competitors that your customers will still use it.

But what we (organized small ISV's) learned from practice is that you should not do what you are trying to do. Do not bind it to hardware. Sell one license per person not one license per computer. In the end you will make more sales because of the relaxed license.

Just do enough to make the honest people stay honest. So limit the trail version (i decided to terminate the application after one hour for me) and leave the final version free from all stuff. Give a separate download for payed customers and thats it. Be a nice company and not a greedy profit maximizing by legal restrictions company.

I used some of the better windows protection programs first but they all had serious problems with my code. And they call get cracked sooner or later. So i gave up all of them.

P.S.: I use a hardware fingerprint schema on windows where i don't restrict the program but just to keep people away from getting new trial keys every 30 days. Together with a nag screen it seems to work. The fingerprint is an xor of user name, windows installation time, modify time stamp of a system files and harddisk serial id.

Lothar