How secret is my PHP code?

Discussion in 'PHP' started by HenryCan, Aug 12, 2014.

  1. #1
    My website makes use of PHP to do various standard things and at least one that is not quite so standard. It has occurred to me that the less-standard thing may be worth some money in the sense that it does something that other people may also want to do on their websites.

    My potentially-valuable code generates a web page dynamically like all the other PHP code that I've seen so far. When I go to the generated web page, I don't see the underlying PHP code that was used to generate the page. Is there any technique, simple or challenging, legal or illegal, that someone could use to determine what my original PHP code was?

    I'm pretty new to PHP but I'm inclined to suspect that it isn't very hard for a skilled PHP programmer to reverse-engineer, decompile or otherwise determine what I did. They could probably just take the source code right off the server without too much trouble, right?

    I'm trying to figure out if there is any point in trying to market this code. It strikes me as something that might catch fire and get used on a lot of web sites. But if it is dirt simple to get the code, there's not much point in trying to sell it since some half-clever individual will just grab my code and then sell it or just give it away.

    Perhaps I'm excessively pessimistic but it already seems to me like something that other people will just do via their own code once they see what I'm doing. They'll just look at what happens and realize that they could accomplish the same thing easily enough via code they could write from scratch in PHP or some other language like Javascript, CGI or whatever.

    Still, if it really IS very difficult for someone else to obtain my PHP code, maybe it would be worth trying to sell this code and make a few dollars on it until everyone else figures out how to do the same thing.

    I'd appreciate any guidance you can offer on this question.
     
    HenryCan, Aug 12, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    PHP is inherently not secret, in the way that anyone with access to the server will be able to see it. Getting access to the raw files, however, should not be possible without blatant security holes, crappy passwords or some other illicit way. There is no easy way to read the PHP from a Web browser.

    That being said, there are ways to obfuscate your PHP code, but it's more often than not just that - an obfuscation. It usually renders the PHP slower, it prevents local optimisation and/or modification of the code, and it's generally not considered "good practice".

    There are plenty of PHP based products out there that sell. WordPress themes, WordPress plugins, php-based websites that offer certain services etc etc.

    You'll always run the risk of reverse engineering, and someone using your code for themselves.

    What you can do, perhaps, is require some sort of api key or license key which will be there for as long as the license is valid, and then remove it if there's something wrong, for instance if one key is being used on multiple sites or similar.
     
    PoPSiCLe, Aug 12, 2014 IP
  3. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #3
    At the risk of coming across like a dick......judging by your question, lack of experience and knowledge I highly highly highly doubt you have something that a programmer with experience couldn't duplicate.
     
    NetStar, Aug 12, 2014 IP
  4. V_RocKs

    V_RocKs Well-Known Member

    Messages:
    97
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    118
    #4
    As stated before it would be impossible to see the code without some kind of exploitable situation on your server whereby somebody could view files without executing them. So as long as your server is secure nobody will come knocking.
     
    V_RocKs, Aug 17, 2014 IP