Re: Advice wanted!
- Posted by ghaberek (admin) Mar 15, 2010
- 1472 views
I've put quite a lot of thought into this over the years. IMHO, tying the software to any amount of hardware is bad practice. Parts are broken and replaced all the time. Don't be like Microsoft and pull a "Vista activation" nightmare. Here's how I'd do it:
- Generate self-checking product keys similar to Microsoft Windows or Office. Develop your own method for this and don't tell anyone. Otherwise somebody might get wise and develop a "generator" for your keys.
- Supply those keys with your software for installation. Have the installation program verify the check digits in key before proceeding. If you develop your own installer, you could even encrypt each installation package with key, then provide a "personalized" download or CD to each person so they cannot "share" the software.
- After installating the files, have your installer collect some information about the current system, but not about the hardware. I suggest the following registry keys:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\LicenseInfo
- Combine your product key with one or more of the value above, plus some optional salt and generate a hash value. Store this hash with your product key in your application data.
- At program startup, re-hash the key + registry info + salt and verify it against the stored hash. Maybe offer your user the opportunity to re-enter their key to verify the installation.
- Have your program "call home" to verify its product key is not registered to another user. A good time to do this is while "checking for updates", so people don't think you're calling Big Brother for no reason.
Of course, there are ways to circumvent anything. People will try to break your methods simply because they can. People will attempt to pirate good software despite their ability to pay for it. In the commercial software industry, piracy is often the highest form of flattery. If nobody wants to pirate your software then you must not be making a very good product.
-Greg