jhbalaji Posted May 12, 2010 Share Posted May 12, 2010 I have written a licensing system for my script and now i saved it an file called lic.php in the root folder I am going to encrypt that with ioncube when giving to a client side and i will simply include include "lic.php" to call the licensing system But the problem is when i simply include the code include "lic.php" the user can directly remove the line to get the script worked So can some one help me in coding a script inside the lic.php which will make the script to prevent from running if the code i.e, include "lic.php" is removed from the file Note that i will include the line include "lic.php" in all the php files in my script Also do you face any issues with ioncube while running?? Great Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/ Share on other sites More sharing options...
aeroswat Posted May 12, 2010 Share Posted May 12, 2010 I believe you will have to encrypt ALL of the files with IonCube if you want that to work. Otherwise it will be pointless Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057248 Share on other sites More sharing options...
jhbalaji Posted May 12, 2010 Author Share Posted May 12, 2010 @Aero: Read the thread completely As i said i will encode only the lic.php file and not other Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057254 Share on other sites More sharing options...
hcdarkmage Posted May 12, 2010 Share Posted May 12, 2010 You could put in your "lic.php" file a variable like: $sugar = "needed"; Then in your other pages use an if statement to see if that variable is found. If the variable is missing, then exit the page or show an error. Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057255 Share on other sites More sharing options...
PFMaBiSmAd Posted May 12, 2010 Share Posted May 12, 2010 And how would that stop someone from either just setting the variable themselves or removing the code that is checking if the variable is set? The only way you can prevent someone from bypassing your lic.php file is if the file that is including and using the information from lic.php is also encrypted. Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057258 Share on other sites More sharing options...
lostnucleus Posted May 12, 2010 Share Posted May 12, 2010 your lic.php needs to have some part of script funcnality also , for .eg <? function notSoImp(){} function mostImportant(){}; ?> change it to <? function notSoImp(){} include "lic.php"; ? now in lic.php add that removed function i.e mostImportant(). Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057259 Share on other sites More sharing options...
hcdarkmage Posted May 12, 2010 Share Posted May 12, 2010 And how would that stop someone from either just setting the variable themselves or removing the code that is checking if the variable is set? The only way you can prevent someone from bypassing your lic.php file is if the file that is including and using the information from lic.php is also encrypted. I agree with you, and I was just offering a suggestion, lol. I was thinking along the same lines and it seems that you would be stuck without a solution unless you encrypt everything. Especially if they have the ability to modify the files to remove the lic.php file. Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057260 Share on other sites More sharing options...
aeroswat Posted May 12, 2010 Share Posted May 12, 2010 And how would that stop someone from either just setting the variable themselves or removing the code that is checking if the variable is set? The only way you can prevent someone from bypassing your lic.php file is if the file that is including and using the information from lic.php is also encrypted. Thankyou. @Aero: Read the thread completely As i said i will encode only the lic.php file and not other You read what I said completely. Like I said before you must encrypt everything. Maybe you should think about what you say before you say it. Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057276 Share on other sites More sharing options...
jhbalaji Posted May 13, 2010 Author Share Posted May 13, 2010 Hi, Here is the Code Have a loo here and please give me a suitable suggestion http://jhbalaji.com/php.txt Thanks Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057852 Share on other sites More sharing options...
Asheeown Posted May 13, 2010 Share Posted May 13, 2010 You need a MUCH MUCH better way of verifying your licenses. Send it to a PHP page and have it verify against a database with string sanitization going on. ANYTHING will be better than that. Seems like you need to focus on that before you actually go locking down the code with this license page. Encrypting each page against formula that's made to generate the license codes is your best bet. This way license codes generated from the formula will be able to decrypt the code and allow it to run. Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1057854 Share on other sites More sharing options...
jhbalaji Posted May 13, 2010 Author Share Posted May 13, 2010 Therefore can you tell me how to code such one! Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1058028 Share on other sites More sharing options...
aeroswat Posted May 17, 2010 Share Posted May 17, 2010 You need a MUCH MUCH better way of verifying your licenses. Send it to a PHP page and have it verify against a database with string sanitization going on. ANYTHING will be better than that. Seems like you need to focus on that before you actually go locking down the code with this license page. Encrypting each page against formula that's made to generate the license codes is your best bet. This way license codes generated from the formula will be able to decrypt the code and allow it to run. Sorry but that's honestly the wrong answer. You cannot encrypt a php page in php... Don't you see the security problem with that? The people have 100% access then to the whatever function you use to decrypt/encrypt it and then its easy to go back from there when you identify a few small keywords. Not to mention whoever will be using his program will not always have access to the host and therefore will not be able to create their own decryption application to decrypt it at runtime. There are lots of hosts out there with ionCube already running on their servers. There's only one answer to this question and its already been stated several times. Accept it or find another forum to bs in. Quote Link to comment https://forums.phpfreaks.com/topic/201518-php-coding-help/#findComment-1059458 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.