licence key generation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • toufik toufik

    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.


  • Justin Koivisto

    #2
    Re: licence key generation

    toufik toufik wrote:
    [color=blue]
    > 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.[/color]

    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

    Comment

    • toufik toufik

      #3
      Re: licence key generation


      "Justin Koivisto" <spam@koivi.com > wrote in message
      news:txyad.270$ Iq6.11820@news7 .onvoy.net...[color=blue]
      > toufik toufik wrote:
      >[color=green]
      > > 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.[/color]
      >
      > 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[/color]

      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



      Comment

      • Justin Koivisto

        #4
        Re: licence key generation

        toufik toufik wrote:
        [color=blue]
        > "Justin Koivisto" <spam@koivi.com > wrote in message
        > news:txyad.270$ Iq6.11820@news7 .onvoy.net...
        >[color=green]
        >>toufik toufik wrote:
        >>[color=darkred]
        >>>I'm looking for a php code that I can use to generate lience key that is
        >>>activated between 2 dates.
        >>>
        >>>Any hint please.[/color]
        >>
        >>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.[/color]
        >
        > 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.[/color]

        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_cod e' 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:



        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

        Comment

        • Gordon Burditt

          #5
          Re: licence key generation

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

          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

          Comment

          • Chung Leong

            #6
            Re: licence key generation

            "toufik toufik" <toufiki@sympat ico.ca> wrote in message
            news:yLyad.1157 8$hk6.291664@ne ws20.bellglobal .com...[color=blue]
            >
            > "Justin Koivisto" <spam@koivi.com > wrote in message
            > news:txyad.270$ Iq6.11820@news7 .onvoy.net...[color=green]
            > > toufik toufik wrote:
            > >[color=darkred]
            > > > Hi,
            > > > I'm looking for a php code that I can use to generate lience key that[/color][/color][/color]
            is[color=blue][color=green][color=darkred]
            > > > activated between 2 dates.
            > > >
            > > > Any hint please.[/color]
            > >
            > > 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[/color]
            >
            > Thanks Justin,
            > What I need execaly, is how can secure my key, so that my customer[/color]
            couldn't[color=blue]
            > create it himself.
            > All this because the customer can see the source code.
            >
            > Toufik. tissad@gvs.ca
            > http://www.gvs.ca
            >[/color]

            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.


            Comment

            • R. Rajesh Jeba Anbiah

              #7
              Re: licence key generation

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

              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?threa d_id=986362&for um_id=236228>

              --
              | Just another PHP saint |
              Email: rrjanbiah-at-Y!com

              Comment

              Working...