Key Generator / Software Activator in c++
Hello everyone!
I want to add a licence expiration feature in my application (written in visual c++).
When the licence expires i would like my application to generate a random numerical key which will be sent to me by the user.
Using this key and a personal key-generator i would like to send back to the user an activation code.
The key/activation-code combination should not be stored anywhere in either sides. They must be as random as they can get.
The user should not need any kind of internet connectivity (my previous activation was web-based and i want to remove it).
What kind of algorithm can i use?
I would like some guidelines or any links to useful information if available.
I am not looking anything that is related on how i could "lock" my application with third party software or anything that has to do with hardware serial numbers etc...
Thanks in advance!
ktsangop
Junior Poster in Training
54 posts since Jan 2010
Reputation Points: 33
Solved Threads: 0
Sorry i didn't make that clear.
The user is responsible of sending me the key via phone, sms or even email but this has nothing to do with the application. The machine on which the application runs could have no internet access.
I'll try to break it down.
Let's say you gave me a key number like 584663214796.
And this number contains a "hidden" information of how we both should compute the activation number. So i calculate it using my private app, and send it back to you.
You compare the number i sent you with your calculation and if they match.. licence is updated.
ktsangop
Junior Poster in Training
54 posts since Jan 2010
Reputation Points: 33
Solved Threads: 0
Well that's what i was looking for!
I've never implemented anything like that so this guide is definetely a useful starting point!
In fact, i already made an algorithm using bitwise calculations on paper.
:)
... often with cool techno music to accompany it.
Still laughing!!!Hahaa!!Btw why do they always do that??
One last question...
I would like to "include" the days of the new licence in the activation key.
Is it too obvious if i place for example 50 days of licence like this:
Key : 923024903113993
Activation : 92302490(50)3113993
of course without the parenthesis!!
:)
Thank you very much!
ktsangop
Junior Poster in Training
54 posts since Jan 2010
Reputation Points: 33
Solved Threads: 0
easier still (and much more secure) to just buy one of the plethora of available commercial products to handle license key generation and distribution...
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Since my licences are 4 : 15, 30, 60 and 90 days i think that i could bitshift the Activation key by 3, 6, 9 and 12 digits respectively and provide a tottaly different key which includes the days of licence.
The client side algorithm will try the four bitshift operations and compare the resulted keys with the original activation key wich includes no licence days.
The shift operation that succeeds will provide also the days of licence.
I think that this level of security is pretty enough for the licence days, since in any way, the number of days could not be more than 90.
The worst that could happen is that a given licence of 15 days will be "hacked" and give the client 90 days.
Well good luck hackers!
:)
Thanks again Greywolf333
ktsangop
Junior Poster in Training
54 posts since Jan 2010
Reputation Points: 33
Solved Threads: 0
easier still (and much more secure) to just buy one of the plethora of available commercial products to handle license key generation and distribution...
Unfortunately this is not an option. I already have a USB dongle in order to lock the application and buying also another type of commercial security product would raise the cost too much.
And it's a lot more fun having to do this on your own!
Either way if someone wants it really bad, he will "crack" it.
:)
ktsangop
Junior Poster in Training
54 posts since Jan 2010
Reputation Points: 33
Solved Threads: 0