Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,

I wrote an application for a bussiness, but the
application needs to run with a cd-key that changes montly.

The client does not have any internet connection. And I
dont want to have a range of strings(cd-keys) declared in the code.
The application might be running at the bussiness for
a few years.

So, what would be the best approach?

(My problem is not with the checking of the cd-key)
Posted
Comments
[no name] 11-Dec-11 14:19pm    
http://en.wikipedia.org/wiki/Cryptographic_hash_function
Sergey Alexandrovich Kryukov 11-Dec-11 19:21pm    
Much better, but it would be very easy to work around the check in decompiled code, just be skipping the check.
--SA
GuyThiebaut 12-Dec-11 4:31am    
Is the issue that the user needs to type in a new cd key each month or is it that you want to prevent the user giving your software and key away to other people(hence the new key each month)?
Ben Paxton 12-Dec-11 4:55am    
No, thats not my problem. Every month the cd key of the app must change and I need to be able to find out what that cd key is. So basicly when he pays me again the beginning of the month I send him the new cd key
GuyThiebaut 12-Dec-11 5:03am    
In which case other than using the computer date/time as a seed for the cd key generation there is nothing much you can do.
If he is dishonest he could reset the system clock - however what I would do is within the program ensure that the date/time is integral to it so that any jimmying of the system clock will show up on the reports etc...

1 solution

It is possible to get the cd key to be linked to the date - however the user could always set the date back at the end of each month...

So here's an idea - log the date/time to a file(encrypted).
On startup check this file to ensure that the date has been incrementing and that the time has been incrementing as well - if the file contains dates/times going back in time lock the software!
 
Share this answer
 
Comments
Ben Paxton 12-Dec-11 5:55am    
Thanks, but this still does not solve my problem.. How am I going to generate a new cd key every month and be able to know what it is. So until the client paid for that month I hand over the new key to him?
GuyThiebaut 12-Dec-11 14:03pm    
The algorithm used to generate the key also exists on the software you supply to the user - obfuscate the variable names etc so that they cannot easily work out how the algorithm works...
If your answer to this is that you don't want the user to have access to the algorithm or be able to hack it - then...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900