Search code examples
c#.netlicensingcryptographylicense-key

When copy protecting, how to check the real date against an expiration date


...working on a primitive RSA (public/private key) based copy protection mechanism for our software. We are not using 3rd party products, but are implementing Microsoft's LicenseProvider model. We have ways in place to identify the specific computer, but have not figured out how to check the current date against an expiration date stored in the license file (.lic).

DateTime.Today obviously is taking the system's date, but what if the user keeps resetting the date to something prior to the expiration date?

Any simpel ideas how this could be more bullet proof, other than fetching the date from an online source? Again, nothing fancy, but better than DateTime.Today :)

As usual, thanks so much!


Solution

  • You can store the date you last checked the license encrypted in the registry. This will provide you with a consistent date and it can also be used to see if the user has set back his system date.