-3

I have a php file. I just want to protect a few line in it. So I need to encrypt file but I still want it works like a normal php file. Which software/tool should I use now? Can you give me an advice.

I want something like this

<?php
... 
normal code
...
encrypted code (Dfhjkllasjdoasd)
...
normal code
?>

Thank you

linuxeasy
  • 6,269
  • 7
  • 33
  • 40
Kien Pham
  • 35
  • 1
  • 9
  • How/When do you intend to use the encrypted code? You'll always need to decrypt it in order to use it. In general, attempting to encrypt the text in script-based files is a waste of time. – adelphus Feb 21 '12 at 09:57
  • Why would you want to partially encrypt a file? Just put the piece of code you want to "protect" in a different file and encrypt that as a whole. – CodeCaster Feb 21 '12 at 09:58
  • What's the use case? Most things like this can be bypassed with enough effort, and it only needs one person to do so and share the code for the whole exercise to be pointless. – Matt Gibson Feb 21 '12 at 09:59
  • I want to protect license checking code that I include in a file. If user remove it, they will share script for free, it called Nulled :( – Kien Pham Feb 21 '12 at 10:00

2 Answers2

1

You can consider using IonCube, PhpSheild, SourceGuardian.

Looking for free? its can be build into php. check bCompiler

Please note, that these encoded/encrypted file can be included in other files too, so you can have some of your files encoded/encrypted and leave which you don't want to.

for Partial textual encryption & decryption see Best way to use PHP to encrypt and decrypt passwords?

Community
  • 1
  • 1
linuxeasy
  • 6,269
  • 7
  • 33
  • 40
0

You could consider moving the important bits into a separate file as functions and compiling them into a PHP extension using something like HipHop. It would increase the hassle of installing your software though, so you need to be sure it's worth it.

Matt Gibson
  • 14,616
  • 7
  • 47
  • 79
  • HipHop doesn't works on windows. for creating php extensions, you don't use hipHop. HipHop is for compiling PHP scripts into executables. – linuxeasy Feb 21 '12 at 10:05