Thread: Get out of my source!

  1. #1
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986

    Get out of my source!

    Is there any way to make it so that once a CGI application has been created in say PHP, its source can't be read by anyone? Sortof like a way of compiling it?

    All I can think of is removing all the newlines....

    What about JSP? Does that get compiled into some kind of bytecode? Or whatabout .NET languages like C#?

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Not with PHP, you can't. But then again, the only way to see the source code would be to FTP/telnet into the server and download it that way.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    Thing is, if I have some software in PHP I'm selling to customers, I don't want them to be able to rip off my PHP source...

  4. #4
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    There is no way to "compile" PHP code to make it unreadable.

    About the best thing you can do is make it overly complicated and use single letters for variables. But they can still copy and use it.

    But like XSquared said, they are going to be the only ones that can see it... anyone else will have to log into their server and steal it.

    Another way to secure it would be to host the files on your own server and force them to pay you to access it from there.

  5. #5

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Oh contare (I think). Wouldn't the "View Source" button display all the PHP code? Or would something about it being run on the server side force it to show something else?

    You asked about .NET. Once the .NET source code is "built" it is changed into "managed code" I believe that this is unreadable like source code, but I'm not sure. That could be your best bet. ASP.NET or something like that would be perfect for the job.

  7. #7
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Look at the source of these pages? Do you see any PHP? It's all executed on the server, so you should never see any PHP code, just its output.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  8. #8
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Originally posted by XSquared
    Look at the source of these pages? Do you see any PHP? It's all executed on the server, so you should never see any PHP code, just its output.
    what he wanst is even the people who own the server should not be able to read the code on the php files...

  9. #9
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    Originally posted by vasanth
    what he wanst is even the people who own the server should not be able to read the code on the php files...
    Exactly.... does .NET or JSP do this? And can either of these languages interface with MySQL?

  10. #10
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    >>what he wanst is even the people who own the server should not be able to read the code on the php files...
    That was a reply to sean_mackrory's post, not the OP.

    >>Exactly.... does .NET or JSP do this? And can either of these languages interface with MySQL?
    AFAIK, JSP is similar to PHP and ASP, that the source code is available to look at. Not sure about .NET though.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  11. #11
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    I guess using .NET you can convert it into some object code which is not the source but the compiled version of the source...

  12. #12
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    .NET compiles into MSIL intermediate code, which can be decompiled into sourcecode with simple tools. There are Obfuscators because of this
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  13. #13
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    You can use servlets as opposed to JSP as they sit on the server as compiled Java Classes, but as with what nvoigt said about MIDL - it can easily be decompiled

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to build, run Boland C++ 6 source file via VS2005?
    By userpingz in forum C++ Programming
    Replies: 2
    Last Post: 05-21-2009, 03:25 AM
  2. Debug into Source
    By lehe in forum C++ Programming
    Replies: 4
    Last Post: 02-18-2009, 10:45 AM
  3. Open Source Licenses
    By Mario F. in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 10-10-2006, 08:53 PM
  4. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  5. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM