ram
ram

Reputation: 53

Encrypt and decrypt a php file using secret key in PHP

I need to encrypt my php file from preventing viewing others.I am the only guy to decrypt it also.Is there any method in php to decrypt and encrypt a file using some secret key ??

Thanks in advance.

Upvotes: 2

Views: 684

Answers (3)

Egret
Egret

Reputation: 46

you can try Zend Guard. http://www.zend.com/en/products/guard/

php commercial encryption software.

Upvotes: 0

James
James

Reputation: 771

The normal way is to use an encoder, ionCube being the most common.

Upvotes: 1

Magnus Lindgren
Magnus Lindgren

Reputation: 287

Unfortunately there is no way to do this. I'm guessing you still want the file to be executeable on the server? In that case in the very least the server needs to be able to decrypt it and therefore have the key anyway. So anyone who is able to access the server will still be able to decrypt the file.

You can encrypt it like any other file, but that would make it unusable as a PHP-file.

Upvotes: 1

Related Questions