SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation php licensing system

    hello I have a problem. I need to make a php application with licensing but I didn't find anywhere a tutorial or a book about this. I hope that you guys might help me.

    I need a complete licensing system for the application so that the user can't run it without. The system should ask the user for the registration code (or something like that ) while the installation process. The application should not be able to run if the code that takes care of the licensing will be removed.

    If you guys can guide me to some books or tutorials that help me with this I would appreciate it.


    Thank you.

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Zend Guard and IonCube both do this.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2008
    Posts
    195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think IonCube is the best shot in this matter.

  4. #4
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know that but I have to do this manually. Must be hard coded not a software solution provided by someone else. Thus I need to understand how it works so I could develop my own.

  5. #5
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and i need a system that not only encodes my php but the are encoded must be critical to the application. Not all the application will be coded, but just the licensing system. The application should not work if the licensing system is deleted.

    To be more specific , how do I make the application not work (and will not be made to work) if the license is deleted?

  6. #6
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by artanis View Post
    Thus I need to understand how it works so I could develop my own.
    It consists of two parts: An encoder which compiles the php into bytecode and then encrypts it with a proprietary encryption algorithm, and a runtime php-extension, which decrypts the encrypted code and transforms it into bytecode, that is then passed to the php runtime.

    Unless you are very familiar with C and have a few weeks to spend on understanding the php runtime system, I don't think you'll get very far. And in any case, you face the problem of cross compiling your decoder for each platform you want to support and convince your users to install it on their systems.

  7. #7
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As they said, Zend Encoder or IonCube.

    There is nothing you can do to develop a licensing system that is not easily circumvented without using those programs (or a less-popular but similar one).

  8. #8
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And how about the second question?

    how do I make the application not work (and will not be made to work) if the license is deleted?

    Because I could encrypt the php as best as I can but if a customer could delete the licensing system and make the application work without that then i've done nothing.

  9. #9
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Require the license script at the top of all your pages.
    Then you encrypt the pages...

    If you wanna add a little more user-friendly error than the PHP error that gets thrown if they delete your license script,
    then create a file_exists() condition at the top of your scripts. If the file does not exist, then give them a more user-friendly error and exit.

  10. #10
    SitePoint Addict webaddictz's Avatar
    Join Date
    Feb 2006
    Location
    Netherlands
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by artanis View Post
    And how about the second question?

    how do I make the application not work (and will not be made to work) if the license is deleted?

    Because I could encrypt the php as best as I can but if a customer could delete the licensing system and make the application work without that then i've done nothing.
    An alternative solution is to not distribute the application, but instead host it yourself. That way, your clients won't be able to circumvent the licensing system.
    Yes, I blog, too.

  11. #11
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may want to take a look at phpAudit as well.

  12. #12
    SitePoint Addict bimalpoudel's Avatar
    Join Date
    Feb 2009
    Location
    Kathmandu, Nepal
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I want to make similar things.
    I want to keep most of the source code clean and readable.
    But it should run only with a license.

    I would prefer to make a big file that includes most of the classes and functions used within the entire application. I think, this is the only one file that I will encrypt it, so that the customers cannot remove the code piece that checks for the license.

    Nor they cannot change the other class files and methods that are not necessary to change. While everything else works well, the application will not work without loading the encrypted file first (because this contains some libraries already essential to run the application).

    Further, there is a little finger back, to see who has used the application. It is done via cURL or loading some image or javascript from the original tracker server.
    Bimal Poudel @ Sanjaal Framework over Smarty Template Engine
    ASKING INTERESTING QUESTIONS ON SITEPOINT FOURM

    Hire for coding support - PHP/MySQL


Tags for this Thread

Bookmarks

Posting Permissions

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