You are here

Protecting software with license keys?

6 posts / 0 new
Last post
Quadrant-X
Offline
Last seen: 14 years 10 months ago
Joined: 2010-03-25 21:02
Protecting software with license keys?

I have written some programs in C++ but need to find a way to "serial-protect them" and have keys that work for X days (like, "enter a valid serial for a one month, one year, or 2 year trial/use") Are there any free/open source or whatever methods to taking a single .exe file (I made them portable with ThinApp) and having the NSIS (or other extractor) prompt for a serial, and (for my part of the job, a key generator for my own software)? I need it (my generator/encryptor) to be able to activate the software for a given (preset) duration. After which, the file will delete itself or make itself useless and prompt for another serial. Any suggestions or names and/or prices of software that can accomplish this without too much hassle would be greatly appreciated. (I'd prefer free/open, but could pay for it as well).

Thanks so much.

alanbcohen
Offline
Last seen: 5 years 6 months ago
Joined: 2006-01-04 10:47
You are really missing the

You are really missing the point of what Open Source means!

solanus
solanus's picture
Offline
Last seen: 10 years 4 months ago
Joined: 2006-01-21 19:12
Interesting question

Admittedly in this regard my expertise is very limited, but as Crazy Idea Guy, I have some thoughts.
Inputting a serial requires that it write to SOMETHING.
If you only have a single exe, and you want it to remember from one session to the next, AND you want it portable, it's got to write to a separate file.
If you don't want a separate file, then you would need the user to input the serial every time, which would be stored in RAM only for the session.

Lots of installed software will write keys to the registry, and time-stamp themselves based on the install date, but that is problematic in a portable app.

What would work is having an algorithm that works on absolute dates.
It would still be dependent on the computer time.

Here's the theory:
The key generated would use the date and some preset info to create a key for a specific date. It could be as simple as using an MD5 or SHA generator for a text file containing, for example:

"April 10, 2010 skjdnfkjsnaksbskakasbdkajbfdkjabfkjabslhbavdsfkjkfdkgf"

Your app would have embedded in it all the keys for every date you can reasonably expect for the lifetime of the software. For five years, that would be 1826 keys, which may not be an unreasonable amount of code. For 10 years, 3652 keys. The app would then compare the inputted key to this list of keys, determine the start date, and then activate the app if the computer date is withing the span of (the start date + x number of days).

Even if the app stores the inputted key in a separate text file, it would be encrypted and difficult to decrypt.

The advantage of this is that it would be fairly easy to automatically generate the keys, and fairly hard to decrypt them. Also, even if the key is shared, it is only valid for a fixed time period no matter when it is inputted, effectively turning itself off after that time period (which is in your original request)

The disadvantage is that it is not unique to the user, so anyone who has the key can use it for that time period. Also, it can be fooled by changing the system time, but in reality any time-dependent key can have a similar weakness.

You might be able to make it user-specific by generating a separate user key, and require both the time key and the user key to work. You would need your app to be able to regenerate the user key internally for comparison.

Hmm.

P.S. The OP didn't say his software would be open source, just that he'd like the key generator to be free/open.

I made this half-pony, half-monkey monster to please you.

Quadrant-X
Offline
Last seen: 14 years 10 months ago
Joined: 2010-03-25 21:02
Perhaps I wasn't CLEAR.

In reply to the FIRST POST here:

The reason this was in the GENERAL DISCUSSION thread is because it's NOT ABOUT PORTABLE APPS. (This is completely unrelated to this website and it's open sourceness.) This question was posed HERE because on other tech forums, I haven't received a reply and the thread died. I was hoping that this wonderful community of experienced users in this field would be able to guide me in the right direction. Now, thanks to poster #2 for the feedback. I am looking into such things now. But for other posters: are there any actual programs that are either free or paid for that I can purchase that will do this? (without editing my program because it's already been compiled and I don't wish to re-work it)?

Thanks for understanding.

I am [this element requires Javascript].

str
str's picture
Offline
Last seen: 11 years 7 months ago
Joined: 2008-06-18 13:20
Take a look

Take a look here:

http://licenser.codeplex.com
http://installkey.codeplex.com (for .NET apps)
http://www.aspack.com/asprotect.aspx

"Off Topic Forum" would've been a better place for this, IMO.

Quadrant-X
Offline
Last seen: 14 years 10 months ago
Joined: 2010-03-25 21:02
perfect.

That's what I wanted. Have a nice day.

I am [this element requires Javascript].

Log in or register to post comments