I'm assuming you asked the question, because you want to implement something similar yourself.
Here I will outline a scheme that can be used to help protect the legitimacy of purchased software. This helps to protect the company from piracy and helps to keep the clients' valuable purchases legitimate and relatively easy to register.
This scheme works by tracking three separate data elements: one auto-generated, one entered by the user, and one calculated from those two. When the product is not activated it could either run with a reduced set of features or simply not run at all.
The procedure involves communication with a website, but when the website is unavailable, there are alternative mechanisms so that the user can still use the software without getting frustrated over licensing issues.
Methodology
The software utilizes three basic data elements:
- [IC] Installation code: An auto-generated code; this could be anything that is generated by the particular installation and is unique to the installation. It will change when the software is reinstalled and does not depend on who is installing it. In the past some vendors have used a hardware hash, but it could just as well be a randomly generated code that is stored for retrieval at each instantiation. Deleting the code from storage is essentially the same as uninstalling the software.
- [UI] User ID: A uniqe identifier for the registered; you could refer to this as an unlock code or a client or company code, or a serial number. It will uniquely identify who has purchased this particular installation.
- [HASH] The hash: A calculated value; this final piece of the authentication is what tells the software that it is legitimately registered and good to go. It should be derivable from the other two parts and stored somewhere, either in the file system or in the Windows registry or elsewhere.
Logic flow
In pseudo code, the software runs through the following procedure:
begin:
load IC
if not IC: IC = generateIC
load UI
if not UI: UI = promptUser
testHash:
load HASH
if HASH=hash(IC,UI): goto valid
HASH = activateLicense()
if not HASH=hash(IC,UI): goto invalid
valid:
REV = revokeLicense()
if REV: goto invalid
done : run software
invalid:
done : do not run software
generateIC:
IC = some unique identifier
store IC
return IC
promptUser:
UI = get id from user input
store UI
return UI
activateLicense:
HASH = wwwResponse('activationRequest')
store HASH
return HASH
revokeLicense:
REV = wwwResponse('checkIfRevoked')
if REV: erase HASH
return REV
The pseudo code also involves an optional fourth element:
- [REV] An indication of a revoked license: the company software company could track the number of software activations and revoke access to abusive users. This does not need to be stored and will only be retrievable if there is an available connection to the www.
Failure to connect to the website would only mean that the state of the license will not change. If the software cannot directly connect to the website, then an alterantive procedure could be available from a web enable point where the user enters their IC and UI into a browser and the browser emails them a HASH which they can manually enter into the software. This is only slightly more involved, but still lets the user do this by themselves with an important factor being that they must enter a valid email if they wish to receive the hash code that will be emailed to them.
It's not hack-proof or undefeatable, but it does serve to protect both parties, in a reasonable way that does not lead to frustration. The actual mechanisms involved should be closely guarded company secrets.
Note:
It doesn't really matter in this scheme whether IC is a hash on the computer's hardware or if it is just some randomly generated key. All that will happen when it changes is that the software will re-register itself, which might not be a problem if the machine it is on is connected to the internet, or might be a slight inconvenience if user interaction is once again required, but as stated above, this part can still be implemented as a self-service feature on the site. It's up to the software company if they want to count number of activations or track other info.