Solved

PHP Encrypt publish files on web server

Posted on 2014-03-28
7
1,082 Views
Last Modified: 2014-06-15
Hello,

I am .net Developer. I have recently started learning PHP as well.

In .net for deploying any asp.net web application, i used to publish the whole project, so it creates .dll file which i use to publish it on clients server. The beauty of .net is whatever source code(C# code) i write, is encrypted in .dll so client is not able to read and cannot access my source code so it s safe.

Can we do that in PHP? when i upload any pgp web application, what i have learned so far is need to upload all php files, class files to clients web server. Now if client can easily download those php file useing ftp software and have access to my source code. How can i protect my source code while uploading php web application.

thanks
0
Comment
Question by:ronipats
  • 3
7 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39961310
Consider using IonCube software.
http://www.ioncube.com/php_encoder.php

However a better solution, more in keeping with current trends in web application development, is to host the web application in the cloud (or on your own servers) and give the client an API.  The advantage you obtain in a setup like this is that you not only get to protect your software, you get to hold the client's data.  It is an arrangement that will keep you in the driver's seat for a very long time.  You can learn more about API designs here:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_12239-Introduction-to-Application-Programming-Interfaces.html
0
 

Author Comment

by:ronipats
ID: 39961367
Sir,
Thanks for comments.

Let me explain few things in details.

I am designing one accounting web application using php. I want to re-distribute this application to many clients who are interested in it.  I will distribute this application to both type of clients. (1. those who want to run this application offline) and (2. those who want to run this application online their web server).

1. For those who want to run this application offline. I will install and configure XAMPP on this machine and install/copy full published project on this offline server.

2. for those who want to run this application online, i will copy/publish this application to their web server using ftp.

Now in both this scenario which techniqies is best suited.

thanks
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39961400
Did you read the links I posted?  When you have read about IonCube, if you still have questions, please post back here.

PHP may not be the right language if you want to distribute applications in the way you describe.  PHP is better suited to server-side web applications.  That is what PHP was, and is, intended to do.  

You can think of it as being like a passenger car.  It's designed to haul passengers on paved roads.  Can you use it to haul chickens on the farm?  Maybe, but the results are likely to be suboptimal for both you and the chickens.  You might want to consider some market research before you choose an application language.  It's easier (read: less costly) to make changes now, before the application has been deployed.
0
 
LVL 9

Expert Comment

by:rfportilla
ID: 39961416
The only option is to have full control of the server.  Even then, if they can hack into the server, which in most cases is not too difficult, they will be able to read the file system and your code.  You can add some file system security to this mix, but you would not be able to give them a privileged user account.  PHP is not made to be secure.  

Even .net can be decompiled.  

There may be an option for obfuscation.  Another may be a semicompiled solution (which is closer to .Net) like hhvm.  I have not used it, though.  It looks like something similar to Java and its  JVM.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40119232
@ronipats: Perhaps you do not understand the grading guidelines.

In accordance with the Experts-Exchange Grading Guidelines, please explain why you gave the worst possible grade.

Thank you, ~Ray
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now