|
How to Protect your php code |
I know lot of u have probably seen that scrambled php code where u cant see any of the commands or any code except some strange symbols
In this tutorial i will show u couple of ways to do that in order to protect your code from code rippers and from hackers.First let me say that even u don't understand anything when u are looking at the scrambled code but php on your server or your local installation of php understand it pretty well so there is no worry that your code will not work.How to make it and how to use will be explained in the rest of
the tutorial
First way is using tools already made for scramble the code.Mostly used are Zend and Ioncube and of course my favorite PHPlockit(commercial)all of them have their advantages and one disadvantage they can be decrypted like everything else but php coding in general is a good way of protecting mostly because those people that can decrypt it have enough experience to code their own things and they don't need to steal anyone's work.Using any of those tools is simple and i will explain it on PHPlockit but its pretty same for most of the encrypting tools
Like all tools first thing u need to do is install PHPlockit,when installed save your files in some folder (in case u want to crypt more than one file),run phplockit and go to options where u can setup your personal encryption key which will be needed later if u want to decrypt file manually.Back on main interface u will see option to add file or folder to crypt and of course the crypt button so select your file and do the encrypting.
Second way is using base64 which is probably the easiest one to decrypt.Base64 encoders and decoders can be found as .exe files for local use or the online version.Now when u found some base64 encoder copy code from your file and paste into some encoder to convert it into base64.now copy encoded text(your code)and paste it back in file.U will have to add eval base64decode on the start of your file so php on server know what to do with it and u will have to mark what code should be decoded o execution.Final file should look similar <?php eval (base64_decode(' your base64 encoded text(code)');
Last one and probably the best one is gzinflate php function.Again u will need base64 encoded text.Now u will have to use php on your server to gzinflate your base64 encoded text
When u do that paste it back in file like <?php eval(gzinflate(base64_decode('your encrypted text');.Opposite way decrypting this will be explained in my next tutorial and for now u can use our online decrypter to decode it until i write tutorial on how to do it manual..
Ok now that u encrypted your file with one of the methods explained in this tut all u need to do is replace your original file on server with encrypted one.
NOTE: Make backup copy of your original file so u can restore it in case u messed something on encrypting it
That's it for now.In my next tutorial i will explain detailed gzinflate process encrypting and decrypting

|