HI, I wanted to know how to secure my php scripts. I have wrote a good script for web hosting billing. Its almost over Now to carry out the last step, i.e., i want to make a license for each script! only when the user enters license key during the installation, then only he can run the script. I tried ZEND and IONCUBE. They are pretty expensive for a novice like me.. So please can you guys suggest me a method to implement a license key system. Would it be better to check it from a mysql database or a simple text file?
I had the same problem as i did not want to shell out so much money on ZEND or IONCUBE so i used http://scripts.datacomponents.net/tenc/
Best way is to generate a random license key and then check it against the key on the central server for that domain. But for anyone competent with PHP, cracking that system would be easy enough without any encryption such as Ioncube.
What you would do is generate a random license for every person that downloads your product. This will sit alongside the files in the file license.txt, then on every request, or for speed issues once a day, this will be checked if it is valid against the central server - the server that they downloaded your script from. This is the most simple way to go about it, check the license against the domain which can be accessed from the following pre-defined array: $_SERVER PHP: So the packet may look like: Key = 5fe5611da36 Domain = WiredFlame.com Code (markup): Then the server would check this data and look for the following row in your database: WiredFlame.com - 5fe5611da36 Code (markup): If it is found then the script will continue to work. If not then you will have to implement your own way to prevent this script from running - such as storing some core files on your server and preventing access to them if the license key is wrong. This way all the files aren't on the client-side and you are semi-protected against any intermediate PHPers from finding a way around it.
I need something like this for a project I'm working on and came accross www.phpaudit.com, should help you out