how to implement a activation code?
Bill Marriott
wjm at wjm.org
Sun Jul 2 20:37:27 EDT 2006
There are many, many ways to do this.
Some of them would involve the standalone "phoning home" to a server which,
would enable or disable the software.
Another method would be to encode the expiration date into the activation
code itself. For example if you wanted it to work the way Revolution does,
with a user emailing in to request a key. The code "knows" when it expires.
A third way is to hide something in the registry (Windows) or somewhere
on-disk where it's not easy to be found.
Here's a very very simple (and thus, easily "cracked") algorithm:
suppose the expiration date is "8/2/06"
the result of
base64encode(compress("8/2/06")) is
H4sIAAAAAAAAA7PQN9I3MAMAKw61YwYAAAA=
8/3/06 is H4sIAAAAAAAAA7PQN9Y3MAMATmkJ2wYAAAA=
9/2/06 is H4sIAAAAAAAAA7PUN9I3MAMAjt3pqAYAAAA=
11/24/09 is H4sIAAAAAAAAAzM01Dcy0TewBAC5rlHDCAAAAA=
Not that while some characters are the same, there's no "obvious"
human-readable pattern.
Also, it turns out that the
"H4sIAAAAAAAAA" prefix and the "AAAA=" suffix are the same for all values
encoded this way. So, your activation code could be:
7PQN9I3MAMAKw61Yw
In the standalone you would add use something like
put "H4sIAAAAAAAAA" into daPrefix
put "AAAA=" into daSuffix
put decompress(base64decode(daPrefix & daCode & daSuffix)) \
into daExpireDate
if daExpireDate > the date then
answer "Your trial period is over"
quit
end if
There are many other, better ways you could "encode" a date (and other
information) into an activation code. This is just one idea. The simplest
code of all could be just three letters:
numtochar(month + 32) & \
numtochar(day+ 32) & \
numtochar(year - 2000 + 32)
Of course, people might guess that.
"Robert Mann" <robmann at gp-racing.com> wrote in
message news:JPEJKOGMGBLMGMPIHNKCOEIKEPAA.robmann at gp-racing.com...
> Is there a sample of how to implement a activation code and or a limited
> number of trial days with a standalone build?
>
>
> Robert Mann
More information about the use-livecode
mailing list