Results 1 to 7 of 7

Thread: encrypt html/javascript source using php

  1. #1

    Thread Starter
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545

    encrypt html/javascript source using php

    Hi,

    I've created a javascript 'game animator' for viewing checker games using javascript. I would really like to avoid having people view and/or steal my code to use in their own game viewers.

    What i would ideally like to do is set it up so that when the encrypted animator.html file is viewed, PHP decrypts this file so that it is readable by the browser (but so they cant view source).

    Is this kind of thing possible with PHP? I'm pretty new to this, and I don't expect someone to do the coding for me. All I'm asking for is a simple yes or no, and maybe a link or two I should look at for more info on this subject.

    Thanks for your time

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Here's the deal.... in order to send it to the browser, it needs to be decrypted so the browser can understand it. If someone does a right-click "View Source" they would be able to get the source that way.

    To answer your question though, yes, PHP could be used to store the file, open it up, decrypt it, and send it to the browser. The specifics of it I'm nott too clear on as I've never done that before.

    Might I suggest you take a look at http://www.dynamicdrive.com - they have javascripts that might be of some use (even a script that preventsthe right-click "View Source")

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Preventing the "right-click" will not secure your code. Most browsers also have a option under a menu to view the source. Look around on the web for obfuscators like this one.

    That won't completely secure your code, but hey, it's a client side script... there's not much more you can do than that.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  4. #4

    Thread Starter
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    I want to do the same thing this guy did with his animator

    Can anyone figure out what he is using to encrypt his animator code? If you try and view it, it's encrypted somehow. Even if you view source, you still cant view it, unless I'm not doing it right.

    The actual code for his viewer is located here

    Anyone?

  5. #5
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    My guess is that he used a really good obfuscator. Did you try looking at one of them? Some are better than others and I'm pretty sure that's how he did his.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  6. #6

    Thread Starter
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    no, its clearly encrypted

    I'm really not interested in an obfuscator

  7. #7
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    CCI Website Security System, will encrypt your source. It uses a cookie as the key, so it is always different. Though, there is a new one in developement, I have suggested the use of this free drop-in PHP script many times.

    It does much more than encryption, by the way, that's just a trick.

Posting Permissions

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



Click Here to Expand Forum to Full Width