My program is password protected. The current password is generated on opening of the program. During generation it is multiplied by the current year. Therefore when I give the program to somebody along with the password that my program sets for them (Which only I know since I know how it is generated) the password changes at the end of that year. This allows me to charge a licensing fee at year end.

My problem is based on the fact that if I sell my program during say September of one year then their password as coded at the moment will only last till the end of that year. I cannot logically charge a licensing fee only three months after initial set up.

My question is this, is there any way in which I could generate a password, using Delphi 7, that would expire exactly one year from initial set up?

有帮助吗?

解决方案 2

Split the key that you give them into two parts using /12 for the key and %12 for the month it is issued. Subtract the modulo part in months from the current date to offset the month and then apply your existing formula. So instead of pwd = key * now.year() it will be something like:

pwd = int(key /12) * date(now - months(key % 12)).year()

其他提示

Try Turbopower OnGuard http://sourceforge.net/projects/tponguard/

It's free and allows you to create a version of your program that will expire after a specific date.

You could give the user a "licence file" instead, consisting of some data about the licence - when it expires, the user's name, etc; and a digital signature that certifies that the licence file was generated by you (or at least, it was signed with your private key).

Then your program verifies the signature using your public key, and if it's valid, takes the rest of the file as gospel.

I am sure there are Delphi 7 libraries that do PKI, although I don't know of any off-hand.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top