artanis — 2009-03-16T17:06:27-04:00 — #1
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.
kyberfabrikken — 2009-03-16T18:32:30-04:00 — #2
[Zend Guard and [URL=http://www.ioncube.com/]IonCube](http://www.zend.com/en/products/guard/) both do this.
yenerich — 2009-03-16T18:58:47-04:00 — #3
I think IonCube is the best shot in this matter.
artanis — 2009-03-16T19:03:02-04:00 — #4
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.
artanis — 2009-03-16T19:21:12-04:00 — #5
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?
kyberfabrikken — 2009-03-16T19:24:58-04:00 — #6
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.
simshaun — 2009-03-16T19:27:22-04:00 — #7
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).
artanis — 2009-03-16T19:31:01-04:00 — #8
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.
simshaun — 2009-03-16T19:44:56-04:00 — #9
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.
webaddictz — 2009-03-17T07:12:16-04:00 — #10
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.
czaries — 2009-03-17T12:04:18-04:00 — #11
You may want to take a look at phpAudit as well.
bimalpoudel — 2010-12-13T23:23:12-05:00 — #12
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).