Registration Code

Fuzzyman fuzzyman at gmail.com
Mon Apr 3 17:16:36 EDT 2006


Math wrote:
> Pffff..Philippe..
> Where can I find some sample code if any?
> And I'm not a professional programmer...
> This is going to be hard...and my native is Dutch..
> Thanks anyway

Distributing your project using py2exe probably removes the need for
bytecode encryption - unless you figure your programme is going to be
attacked by determined hackers.

If it will be, encyption won't be enough anyway.

Just include a registration check in your code and make sure you
provide a way to enter a key. At the start of the program check the
date to see if the program has expired.

There are several ways of doing this. You can write to the windows
registry the date the program is first run and count the date from
then, or hard code an expiry date into your application.

Writing to the registry is not difficult - but you will need to learn
how to do it. There are lots of resources on this and a standard
library module to do it. (``_winreg`` I think  ?)

You will need a scheme to generate keys - a simple algorithm that can
generate unique keys. Your program will need to include a way of
checking that entered keys are valid.

For example you could use the hexadecimal representation of two prime
numbers plus an odd number and then reverse it - or some other obscure
code. I'm sure there are lots of key generating algorithms documented
online.

Alternatively you could use CNET (or similar service) to sell and
distribute your program. They will wrap your executable in code that
does all of this for you.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

>
> Hi,
>
> A suggestion:
>
> I would use encryption (ex: AES):
>
> Hide a secret key in your code and generate an encrypted (readable: ex 07 7B
> 6F ....) version of the correct info (such as full release, or demo expire
> in ...) with that very same key.
>
> Have your software input that encrypted info (some GUI dialog box), decypher
> the info then act accordingly.
>
> The trick is: where to store that ? I would use some binary data file
> (encrypted bziped pickle ?) with a hash or CRC built in to prevent obvious
> tampering.
>
> Hope that helps,
>
> Philippe
>
>
>
>
>
>
> Math wrote:
>
> > Hello,
> >
> > I wonder if I can ask this particular question here...
> > I'm writing this piece of Python Software and I'm almost done...:-)
> > But now I want the end-user to register this software with a registration
> > code or perhaps something like an evaluation demo version which expires
> > after some period of time...
> > Is this the right place to ask or does anybody know where to look for more
> > on the subject?
> >
> > Thanks
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list