Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need PHP License Script

    Hi, Im looking into creating my first PHP license script or even getting one for free or buying one, Basicly what I need it to do is to make license keys for a script im developing how dose this work out, like for example the script wont work without a valid license.... im creating a gaming script

  • #2
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    More often than not these are done in individual files that the script will always have to run through (eg the bootstrap file). This simply checks the key is valid each and every time the script is run (you could have a "call home" version of it or an algorithm that checks the current domain against the key (with salting or something like that) and terminates the script if they don't match). These files are then encrypted with something like ioncube/zend encoder to make reverse engineering the script more difficult as php by default is plain text

    only the bootstrap needs to be encrypted so it's a pretty straightforward method and will work for the majority (but not all) installations.

    As they say, nothing is impossible, and it's possible to reverse all encryptions as far as I'm aware. Note that you will require the extensions for these encryption systems on each server that will operate it, in order for them to run the code properly. I think most come with the zend optimizer, but I'm not sure about the ioncube one so you would need to do some research into it

    There are of course more basic methods of encrypting such as using base64 encoding and decoding which will work on every server, but these are childsplay to decode, even for amateur php programmers, so they wont offer much in the way of protecting your source code
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #3
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    I do it like this:

    when our application platform installs a new version of our software for a client it writes the license key into a config file.

    within the application its self there's a simple web service call to a service running on our server that spits back simply the license key to our main web server.

    this web server checks the key against our internal license database which stores how many user licenses are available for that key.

    this then sends back a code and a number so if the key is valid it sends back 1,5 which would be valid and 5 users.

    if the code is invalid it sends back a zero.

    if the appilication receives an invalid license it then denies all logins apart from primary admin who can then goto license management and either insert a new license key or buy more user licenses.

    If the license is valid users can login but on the user administration page the admins cannot create more users than their max user limit

    if user limit is reached it spits out a warning saying they need to buy more users for their license etc.

    its alot simpler than it sounds and its not "perfect" but it is quick.
    A programmer is just a tool which converts caffeine into code

    My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
    My hobby: http://www.angel-computers.co.uk
    My life: http://www.furious-angels.com

  • #4
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    You can deeply embed a code in your script, and cross it through many scripts changing the variables so it's really hard to track down (for non-expert coders). Also having it a couple dozen times in your script would take a really long time to remove it all.

    It would be cross checked on a different site. So like when the script runs, it checks the code with your site to see if its valid. Or for copyright protection, you can just say, hey if this string isn't there, stop everything.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •