Link to home
Start Free TrialLog in
Avatar of Insoftservice inso
Insoftservice insoFlag for India

asked on

Encrypt php and js code and monitor file changes

I want to encrypt my php and js code .
Server: linux
Hosting: shared type.

I can't change server setting as its shared server.

Issue my client always complaints that there is issue in some functionality when checked it came to our notice that file has been updated. We are 100 % sure that one of clients member do such type of changes so as to cancel my deal as it had happened more than 3 times.
So , i want to monitor whether there is any changes in my code and secondly encrypt my php and js code
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sidebar note... I tried this and had no success.  Seemed like a good idea, too bad it did not work.
http://fopo.com.ar/
Avatar of Insoftservice inso

ASKER

PHP Obfuscator  i hope all encoding tool has to be first installed on server for decoding it right?
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Inquired they don't have such facility. Is there some other solution for the same
Any php or tool script to minimize all php and js scripts
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
?????, , maybe I look at your stated problem differently? As you say -
    "one of clients member do such type of changes"

I take this as this - "clients member", has full read and write access to the specific PHP file-script on your server? And for this "clients member" to "cancel my deal" they Overwrite your specific PHP file-script on your server?

As To your - "want to monitor whether there is any changes", you might consider a linux CRON, that checks this PHP file every 15 minutes or so with some sort of checksum HASH value. If the file HASH does not match the stored HASH, then rename the file, move the file, or delete the file (or other file disable thing). But this will be some extra work for you!


As to limiting others access to the file, there may be a solution, but since you mention "encrypt", I will talk about that. ALL, and I mean ALL encrypt methods only help, if there is a secrete "Key" value that the encryption and the decryption agents (php scripts in this case) use, , that No One else knows! !  If your threat as this "clients member" can read your PHP file and-or javascript with the "Key" in that file, then encrypt, Will NOT Help.

What I would suggest, is that you have a type of "Log-In" to access this Info (your deal, I guess), where you have to know a secrete "Key" value entered into a <form> input, which is used to decrypt the deal information from an "encrypted file" or other PHP string source. That way only you, or someone that knows the secrete "Key" can get access to the hidden info. You can not have this secrete "Key" on your server in a file!

It may be possible to use a javascript decryption , where you have to enter a secrete "Key" to <input> and then get the info, , But this may be a complex multi-platform (php- javascript) code headache.

You may need to see about your user-member PHP file access, and why a member that is a threat (malicious) has access to your Deal data file?

Ask questions if you need more info, but a simple solution may not be possible? Again someone that is not authorized should NOT have access to your important files! ! !
Thx for all comments.
I was thinking to decrypt some imp php - javascript code and then minimize all js and php code keeping original copy at my end.
Is there any tool to do so. or php script for the same
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"imp php"? - means important php files. i.e files beside standard files of framework.
I can't use ioncube or zendguard as server does not supports it and i can't shift to other hosting server for the same.
I meant by encrypting the code and then minimizing it is because, intruder will not be able to use the code or change it easily.

I want to script or tool which could remove space and minimize php code.
I hope my points are now clear
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx @Slick812 .
Is there any tool to minimise js. i don't want to do it online as i have got site which captures one js at a time and i have lot of js files and i dont want to do it one by one.
It would be great if i have some script to do it offline.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx ton to all