Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent Unlicensed Use 1

Status
Not open for further replies.

TLowder

Programmer
Joined
Mar 20, 2002
Messages
224
Hello,

I want to create a license / registration key. I've done a lot of reading here on the subject and haven’t exactly found what I’m looking for. I'm not trying to make a hack proof system but simply a deterrent that pops up a prompt for an activation number. I feel many people believe if they can simply install it then its ok for them to do so. Using an activation prompt, even if it isn’t full proof, at least alerts them that what they are doing is not legal. I plan on reading a number then input that into my key generator then enter the new number as the activation / license number. These are on computers I setup and I don’t sell my software to the general public therefore I believe this approach is good for my situation.

I’ve tried hardware ID’s and supposed serial numbers (CPU & HD) but they return the same value on identical machines and are not unique. This leads me to believe they aren’t actually serial numbers but ID's. Anyway, because they aren’t unique, I'm thinking of basing this off of the windows product id in the registry. Specifically -

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProductID

Would this be a unique key? Will this number never change? The last thing I would want would be for a windows update to change the number or location causing valid systems to be locked out until they get a new key. I’m also not concerned of this working on other OS’s. All I use is XP Pro. Or does anyone know of a better unique number to base my key off of?

Thanks,


Tom
 
I would be tempted to use a mac address for this. Each network card has a unique mac address. While it's possible that you can change it, this isn't likely to happen. It's possible that your user could replace their network card (again, not likely to happen), so you may face a situation where you need to 're-activate' the software. In my experience, network cards are pretty stable, and the mac address is usually a good 'unique identifier' for a computer.

The following thread shows 2 methods for obtaining the mac address.

thread222-874992

I would not base my 'uniqueness' on the windows product id stored in the registry. I don't have any proof, but I suspect that value is more likely to change than the mac address.

I should also mention that I (personally) don't use this for licensing within my application, but I have used this method to identify computers on my network to control configuration files (so each computer has it's own) and it's worked very well for me so far.


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thanks George.

I'll go with your advice and use the NIC MAC address. I agree it sounds better than the product ID in the registry. I'm going to use the example provided by Strongm as it returns the local area connection MAC address only. The example by tsuji returns values for other devices and wireless adapters. I tested Strongm's example and it does not return the wireless adapter info when present. This is good in case they ever add a wireless adapter, I wouldn't want that to interfere with the keys.

Thanks,

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top