Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How To Hide Code When Remote Scripting with IFRAME, Javascipt & PHP?

    Hi,
    I am planning to use Remote Scripting with IFRAME, javascript and php. The problem is that I want to hide the javascript and php code from visitors, so that they can't look at my code inside the js and php files. This is a business site, I don't want hackers to look at my code. How can I do that?

    Many thanks.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    This has been asked a zillion times and is in the FAQs. The answer is - you can't.

    Q: How do I hide my JavaScript source code?

    ------------------------------------------------------------------------

    A: JavaScript, the way you most likely are using it, is a client side technology. That means that if you at all want to use JavaScript on your web site, it must be sent to the client in such a way that it can be read by the client machine and executed there. What happens at the client is not controllable by you - if the machine is able to read it, so is your user. Thus, any try at hiding the source code is futile. Anything you try to do to make it harder to read by the user is still not enough, because when the machine can read it out for execution, so can a user. So, forget all about trying to protect your source code. Place a copyright statement on it instead, that's the best copy protection that you will be able to find.

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I like to go around and track down all users, and tape their eye lids shut with masking tape. If that doesn't work, I use that thingy on the Men in Black movie that takes away their memory. And if that doesn't work, I change my name and move to the next state.

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by dealmaker
    I am planning to use Remote Scripting with IFRAME, javascript and php. The problem is that I want to hide the javascript and php code from visitors, so that they can't look at my code inside the js and php files.
    no one can see the PHP anyway, since that's processed serverside. as for the JS, it shouldn't include anything which reveals the business of logic of your application anyway, only being used for display purposes and presentation processing, ie deciding which data goes where in the layout.
    *keep it simple (TM)

  • #5

  • #6
    Regular Coder
    Join Date
    Mar 2005
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what about encrypting the code with php: md5 or other encryption methods?

    For example dan benjamin uses encryption (with UTF-8 entities) to encrypt a javascript e-mail link ...

    a high levell of encryption is needed - This is an example to encode a mailto:link with javascript (works only when javascript is enabled).

    <http://automaticlabs.com/products/enkoder>
    Last edited by _com; 07-13-2005 at 11:11 AM.

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Any form of encryption is futile because...
    Quote Originally Posted by Javascript FAQ
    ...if the machine is able to read it, so is your user.
    ...when the machine can read it out for execution, so can a user.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •