المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Preventing user from changing dates and breaching software license



C# Programming
05-17-2009, 08:57 AM
Hi Guys

Here's the description of the licensing component I've created: -

1. I created a pair of asymmetric keys using RSA algorithm. I embeded the "public key" into the code and kept the "private key" securely with me.
2. Now, when a user tries to run the program, the program looks into registry for a valid license string. If not found, it does the following: -
a. It pulls out a string comprising of the MAC-ID and CPU-ID and hashes it using MD5 algorithms.
b. The above hash is sent back to me by the user.
c. I sign this hash using my private key, and add the start-date and end-date for the license period, and create a license string for the user. This I send back to the user and he enters this into the program.
d. The program, now verifies the signature of this license using the public key. If successful, it matches the MAC-ID and CPU-ID to make sure that the license is intended for this very computer hardware. it then saves this license key into registry to perform the license validation everytime the program is run.

It all works fine, except the following - Let's say I've provided the license for the period between 01 Jan 2009 to 31 Dec 2009. The license is valid as long as the local date on computer of the user is within this range. This means the user can change the date and keep running the program even if the license period expires. I know this is a standard problem, and I also hope this must have been solved. All I'm looking forward is to fix this.

Pls suggest.

Sunny