Sample code for generating license keys

BlitzMax Forums/BlitzMax Programming/Sample code for generating license keys

ozak(Posted 2006) [#1]
Anyone got any? I know how it's done, so it's usually just a question about modifying some generation parms to customize it to your application.
So it would be sweet if anyone had some blitzmax code ready to throw in :)


tonyg(Posted 2006) [#2]
This should be easy to translate to Bmax.


ozak(Posted 2006) [#3]
Right. I knew there where a blitz3d version, just couldn't find it :)


xlsior(Posted 2006) [#4]
The only thing that looks like it doesn't work right in that version is the following line:

If Len(tname) = n Then tname = tname + "~"

Since the ~ is a special character in BlitzMax...
Correct me if I'm wrong, but shouldn't that be changed to:
If Len(tname) = n Then tname = tname + "~~"

?


Dreamora(Posted 2006) [#5]
in BlitzMax yes.
But the version is for Blitz3D where this is ok (and naw the imported is not intend to work :P)


Red Ocktober(Posted 2006) [#6]
i was just thinking about this the other day... (i must be feeling that i'm getting near the end of my sub thing :) )... and i decided on something a lil different from the example linked to above...

for registration via online registration, the user runs the registration app on the machine that he/she plans to use the app on... it gets the MAC ID, mangles it some way, then prompts the user to send it up when ordering...

a pre set algorithm, already coded into the app will check the reg code the user receives upon registration, and enters, and it will be saved in the app directory so it can be checked whenever the app is run...

it will be valid only for the machine (or more correctly, for the network card in that machine)... this should at least provide a layer of protection against unauthorized use...

the hardest part was figuring out how to read the MAC ID in Blitz3D...

--Mike


xlsior(Posted 2006) [#7]
it will be valid only for the machine (or more correctly, for the network card in that machine)... this should at least provide a layer of protection against unauthorized use...


Until they upgrade their machine at least, so I hope you have continuing support available for when the app won't work after a motherboard or NIC upgrade...

This can be mitigated a little by checking multiple things about the system, and allowing it to run if 'some' of them match.... That's how XP does it, you can change several hardware components before XP wants re-activation.

MAC address, make/model of the video card, BIOS revision and/or date, CPU ID, amount of memory, harddrive serial number... Plenty of options.


Red Ocktober(Posted 2006) [#8]
good point x... and doing multiple checks is good as well... but all of em are subject to what you said in the beginning...

... any major hardware change could invalidate the registration... just like what happens with the WIndows activation, PaceMaker, and a few other apps i've licensed.

any other options out there...

--Mike