licence key generation

This is a discussion on licence key generation within the PHP Language forums, part of the PHP Programming Forums category; Hi, I'm looking for a php code that I can use to generate lience key that is activated between ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-11-2004
toufik toufik
 
Posts: n/a
Default licence key generation

Hi,
I'm looking for a php code that I can use to generate lience key that is
activated between 2 dates.

Any hint please.


Reply With Quote
  #2 (permalink)  
Old 10-11-2004
Justin Koivisto
 
Posts: n/a
Default Re: licence key generation

toufik toufik wrote:

> Hi,
> I'm looking for a php code that I can use to generate lience key that is
> activated between 2 dates.
>
> Any hint please.


More information needed... You'll need a database with 3 fields, key,
start, end. Beyond that, we'd need to know what you are trying to
accomplish.

--
Justin Koivisto - spam@koivi.com
http://www.koivi.com
Reply With Quote
  #3 (permalink)  
Old 10-11-2004
toufik toufik
 
Posts: n/a
Default Re: licence key generation


"Justin Koivisto" <spam@koivi.com> wrote in message
news:txyad.270$Iq6.11820@news7.onvoy.net...
> toufik toufik wrote:
>
> > Hi,
> > I'm looking for a php code that I can use to generate lience key that is
> > activated between 2 dates.
> >
> > Any hint please.

>
> More information needed... You'll need a database with 3 fields, key,
> start, end. Beyond that, we'd need to know what you are trying to
> accomplish.
>
> --
> Justin Koivisto - spam@koivi.com
> http://www.koivi.com


Thanks Justin,
What I need execaly, is how can secure my key, so that my customer couldn't
create it himself.
All this because the customer can see the source code.

Toufik. tissad@gvs.ca
http://www.gvs.ca


Reply With Quote
  #4 (permalink)  
Old 10-11-2004
Justin Koivisto
 
Posts: n/a
Default Re: licence key generation

toufik toufik wrote:

> "Justin Koivisto" <spam@koivi.com> wrote in message
> news:txyad.270$Iq6.11820@news7.onvoy.net...
>
>>toufik toufik wrote:
>>
>>>I'm looking for a php code that I can use to generate lience key that is
>>>activated between 2 dates.
>>>
>>>Any hint please.

>>
>>More information needed... You'll need a database with 3 fields, key,
>>start, end. Beyond that, we'd need to know what you are trying to
>>accomplish.

>
> Thanks Justin,
> What I need execaly, is how can secure my key, so that my customer couldn't
> create it himself.
> All this because the customer can see the source code.


OK, so what you are doing (as an example) is:

1. Selling useage licenses to some PHP scripts for a client

2. You only want the licenses to work for a certain date range (like
from now until a year from now)

3. Clients will need to pay fees to renew the license or the scripts
stop working.

There are a few ways you can do this. First the paranoid license keeper way:

You will need to have some kind of permanent database set up. Use 3 fields:
id - varchar(32),
startdate - timestamp,
enddate - timestamp

Then, in the application that uses the licenses:
<?php
$q="SELECT count(*) FROM script_licenses WHERE id = ".
"'$customer_code' AND startdate >= '".time()."' ".
"AND enddate <= '".time()."'";
// do the query, get result into $result

// if the entered license is good, the result should be 1
// if not, it should be 0
?>

You'll want to do that only once per request or session so you don't
slow down the client site too much, and keep your database server from
getting pounded too hard.


OK, that's really all I can think of right at this moment. However, you
should be able to set up a file that contains some kind of encrypted
string that contains the start and end dates that the script will run
for. Of course, by giving the client a file that has the keys, they may
be able to decode it by searching the source code.

Also, one thing you may want to look into is Turck MM Cache and its
encoding:

http://turck-mmcache.sourceforge.net/index_old.html

I've yet to have a chance to play with it, but it does look a bit
promising. I know that the server-side install only took a few minutes. ;)

--
Justin Koivisto - spam@koivi.com
http://www.koivi.com
Reply With Quote
  #5 (permalink)  
Old 10-11-2004
Gordon Burditt
 
Posts: n/a
Default Re: licence key generation

>What I need execaly, is how can secure my key, so that my customer couldn't
>create it himself.
> All this because the customer can see the source code.


If the customer can see the source code, the customer can modify the
source code so it doesn't require, look at, or need a key.

Gordon L. Burditt
Reply With Quote
  #6 (permalink)  
Old 10-12-2004
Chung Leong
 
Posts: n/a
Default Re: licence key generation

"toufik toufik" <toufiki@sympatico.ca> wrote in message
news:yLyad.11578$hk6.291664@news20.bellglobal.com. ..
>
> "Justin Koivisto" <spam@koivi.com> wrote in message
> news:txyad.270$Iq6.11820@news7.onvoy.net...
> > toufik toufik wrote:
> >
> > > Hi,
> > > I'm looking for a php code that I can use to generate lience key that

is
> > > activated between 2 dates.
> > >
> > > Any hint please.

> >
> > More information needed... You'll need a database with 3 fields, key,
> > start, end. Beyond that, we'd need to know what you are trying to
> > accomplish.
> >
> > --
> > Justin Koivisto - spam@koivi.com
> > http://www.koivi.com

>
> Thanks Justin,
> What I need execaly, is how can secure my key, so that my customer

couldn't
> create it himself.
> All this because the customer can see the source code.
>
> Toufik. tissad@gvs.ca
> http://www.gvs.ca
>


For that, you need a asymmetric cipher like RSA. It's possible to implement
that in PHP, although most servers don't have the GMP extension. Besides, as
Gordon said, if your customers can see the source code, then they can
comment out any restriction you put it.


Reply With Quote
  #7 (permalink)  
Old 10-12-2004
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: licence key generation

Justin Koivisto <spam@koivi.com> wrote in message news:<kjBad.276$Iq6.11897@news7.onvoy.net>...
<snip>
> Also, one thing you may want to look into is Turck MM Cache and its
> encoding:
>
> http://turck-mmcache.sourceforge.net/index_old.html


I'm not sure if it will work with PHP 5 _though_ many claim so.

Zend, "The PHP company" hunted Dmitry Stogov, the author of Turck
MM Cache by the end of 2003 and he seems to be working for Zend
accelerator. phpSt.Manuel Lemos was suggesting him to update the
license to non-GPL; but he doesn't seems to get any reply. More
politics and flames here
<http://sourceforge.net/forum/forum.php?thread_id=986362&forum_id=236228>

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0