How to encrypt the code in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
syamswaroop
Forum Newbie
Posts: 19
Joined: Fri May 01, 2009 1:31 am

How to encrypt the code in PHP

Post by syamswaroop »

hi all,
I want to know how to encrypt the code in PHP.
and what are all the tools (free) available and which is the best one to use.
Will web server will be able to run the encrypted code?


Thanks,
sam
naffan
Forum Newbie
Posts: 6
Joined: Mon Mar 22, 2010 2:39 am

Re: How to encrypt the code in PHP

Post by naffan »

md5("your password")

is that mean?
syamswaroop
Forum Newbie
Posts: 19
Joined: Fri May 01, 2009 1:31 am

Re: How to encrypt the code in PHP

Post by syamswaroop »

what i want is to encrypt the whole file so that others will not use it?
naffan
Forum Newbie
Posts: 6
Joined: Mon Mar 22, 2010 2:39 am

Re: How to encrypt the code in PHP

Post by naffan »

for example:
crypt
$str ="this is my name";
$temp=crypt($str);
echo $temp;
Griven
Forum Contributor
Posts: 165
Joined: Sat May 09, 2009 8:23 pm

Re: How to encrypt the code in PHP

Post by Griven »

Encrypted PHP code cannot be executed by the server. In addition, there is no need to encrypt your PHP code, as the code itself is never shown to your website's users. The only thing that they will see is the HTML that is output to their browser.

If you want to encrypt the PHP files for offline storage, you may want to look into a program like TrueCrypt.
Post Reply