There are many ways to enforce the software licensing for local machine copy protection: CPU ID, network card mac address, hard disk serial number, etc. But they all have some pitfalls: the first is hard to get these information reliably; the second is these information is the privacy of the users and should not be revealed or recorded.
In our .Net Licensing, we’re using a new, simple and reliable way, probably used by nobody else. The trick is to encrypt any data (a known GUID, for example) using DPAPI, and embed the encrypted data into your license file. Because the encrypted data is copy protected against local machine, your license file, and your application/component relies on the license file is then copy protected.
private static readonly Guid Guid = new Guid(0x1f079cbe, 0x96c8, 0x46fd, 0x86, 0x31, 0x2c, 0x7d, 0x7e, 0x4d, 0xa8, 0xca);
byte protectedDataBytes = ProtectedData.Protect(Guid.ToByteArray(), null, DataProtectionScope.LocalMachine);
Byte bytes = ProtectedData.Unprotect(encryptedBytes, null, DataProtectionScope.LocalMachine);
if (new Guid(bytes) != Guid)
Easy, huh? Some may argue that re-installing the operating system will result in a license file regenerating. Yes, it’s true. But the fact is license file regenerating is not avoidable any way, if you make your software copy protected against local machine. Any identity of the local machine, either hardware or software, can be changed - it’s rude to sell your customer a software not allowing them to change their machine configurations.