Hiding Script


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Hiding Script

  1. #1
    Gary Guest

    Hiding Script


    What are some ways to make it difficult for someone to view your script code?
    I realize there is the script encoder, but I need don't want the user to
    have to update their script engine to use it.

    I'm very new to scripting, but have created an online app that uses remote
    scripting, ASP, COM, DHTML. We are in a competitive market, and don't want
    to help out the competition in anyway, if you know what I mean.

    Does moving your script to a .js file hide the code in any way? If so, what's
    the least amount of code that needs to included in the initial html download?

    Since I'm using innerHTML method to dynamically change the content of the
    page, when I go to view source, I only see the original download. Is there
    an easy way to view the "changed" HTML? If not, could I download my client-side
    script with a Remote Scripting call that returns all the script code and
    place it somewhere on the page with the innerHTML method?

    Any insight on this subject would be greatly appreciated.

    Thanks for listening.

  2. #2
    Sylvain Bujold Guest

    Re: Hiding Script


    I don't know much about encoder and all these stuff....
    for .js, here's the code you need in your html file:
    <SCRIPT language=JavaScript src="scripts/homepagefr.js"></SCRIPT>

    and for use a function from homepagefr.js:
    <Script language=javascript>Function()</SCRIPT>

    So, as you can see, it's not big deal....
    Sylvain Bujold


    "Gary" <gchoma@invtitle.com> wrote:
    >
    >What are some ways to make it difficult for someone to view your script

    code?
    > I realize there is the script encoder, but I need don't want the user to
    >have to update their script engine to use it.
    >
    >I'm very new to scripting, but have created an online app that uses remote
    >scripting, ASP, COM, DHTML. We are in a competitive market, and don't want
    >to help out the competition in anyway, if you know what I mean.
    >
    >Does moving your script to a .js file hide the code in any way? If so,

    what's
    >the least amount of code that needs to included in the initial html download?
    >
    >Since I'm using innerHTML method to dynamically change the content of the
    >page, when I go to view source, I only see the original download. Is there
    >an easy way to view the "changed" HTML? If not, could I download my client-side
    >script with a Remote Scripting call that returns all the script code and
    >place it somewhere on the page with the innerHTML method?
    >
    >Any insight on this subject would be greatly appreciated.
    >
    >Thanks for listening.



  3. #3
    Gary Guest

    Re: Hiding Script


    Sylvain-

    I discovered that when you use an include file, that file is downloaded to
    the user's machin (in the temporary internet files folder for IE).

    I have yet to experiment with the innerHTML method in trying to hide script
    code. I would need to write a server side routine that would read in a .js
    file and output it to the clien (via Remote Scripting) where I could place
    the code into the page:

    //assuming that a reference to a server-side object has
    //been setup already with Remote Scripting, and a
    //<div id="myDivTag"></div> has been placed in the HTML stream,
    //the call would look like this:
    myDivTag.innerHTML = aspObject.GetScriptCode();

    I'll have to report findings after I try it.

    Gary


  4. #4
    Gary Guest

    Re: Hiding Script


    I was able to "hide" my script by the described method below. When page content
    has been changed with the innerHTML method, and you do a "view source" on
    that page, you don't see the new value of that innerHTML in the source.
    Obviously, if it's HTML that is renderable in the browser, you will see the
    rendered results of the new HTML in the browser window, but the HTML source
    code will not be contained in the source code for that page (it's only in
    memory?).

    Unless you somehow are able to view or "dump" the contents of memory (alot
    of work or know-how, no?), you will not be able to see the script.

    If anyone needs help getting this working, email me.

    Gary

    "Gary" <gchoma@invtitle.com> wrote:
    >
    >Sylvain-
    >
    >I discovered that when you use an include file, that file is downloaded

    to
    >the user's machin (in the temporary internet files folder for IE).
    >
    >I have yet to experiment with the innerHTML method in trying to hide script
    >code. I would need to write a server side routine that would read in a

    .js
    >file and output it to the clien (via Remote Scripting) where I could place
    >the code into the page:
    >
    >//assuming that a reference to a server-side object has
    >//been setup already with Remote Scripting, and a
    >//<div id="myDivTag"></div> has been placed in the HTML stream,
    >//the call would look like this:
    >myDivTag.innerHTML = aspObject.GetScriptCode();
    >
    >I'll have to report findings after I try it.
    >
    >Gary
    >



  5. #5
    Alligator Jackal Guest

    Re: Hiding Script


    All they have to do is view source code, find out the name of the JavaScript
    file, and then either search for it on their hard drives in their temporary
    internet folder or view-source: the document from your website. It's impossible
    to hide to script code.

    "Gary" <gchoma@invtitle.com> wrote:
    >
    >I was able to "hide" my script by the described method below. When page

    content
    >has been changed with the innerHTML method, and you do a "view source" on
    >that page, you don't see the new value of that innerHTML in the source.


    >Obviously, if it's HTML that is renderable in the browser, you will see

    the
    >rendered results of the new HTML in the browser window, but the HTML source
    >code will not be contained in the source code for that page (it's only in
    >memory?).
    >
    >Unless you somehow are able to view or "dump" the contents of memory (alot
    >of work or know-how, no?), you will not be able to see the script.
    >
    >If anyone needs help getting this working, email me.
    >
    >Gary
    >
    >"Gary" <gchoma@invtitle.com> wrote:
    >>
    >>Sylvain-
    >>
    >>I discovered that when you use an include file, that file is downloaded

    >to
    >>the user's machin (in the temporary internet files folder for IE).
    >>
    >>I have yet to experiment with the innerHTML method in trying to hide script
    >>code. I would need to write a server side routine that would read in a

    >.js
    >>file and output it to the clien (via Remote Scripting) where I could place
    >>the code into the page:
    >>
    >>//assuming that a reference to a server-side object has
    >>//been setup already with Remote Scripting, and a
    >>//<div id="myDivTag"></div> has been placed in the HTML stream,
    >>//the call would look like this:
    >>myDivTag.innerHTML = aspObject.GetScriptCode();
    >>
    >>I'll have to report findings after I try it.
    >>
    >>Gary
    >>

    >



  6. #6
    Gary Guest

    Re: Hiding Script


    If you change the pages contents using the innerHTML property (IE only), the
    source will NOT be displayed when you do "view source" in you browser!!

    I HAVE effectively hidden my script code by downloading it into a DIV tag
    (via Remote Scripting) AFTER the original page has loaded. YOU CANNOT SEE
    IT WITH "view source", and it is not in a .js or any other file in your temporary
    internet folder, or anywhere else on your hard drive.

    Did you read my ALL my post? I seem to be repeating myself.

    Later Alligator,
    Gary

    "Alligator Jackal" <bmchhs@email.com> wrote:
    >
    >All they have to do is view source code, find out the name of the JavaScript
    >file, and then either search for it on their hard drives in their temporary
    >internet folder or view-source: the document from your website. It's impossible
    >to hide to script code.
    >
    >"Gary" <gchoma@invtitle.com> wrote:
    >>
    >>I was able to "hide" my script by the described method below. When page

    >content
    >>has been changed with the innerHTML method, and you do a "view source"

    on
    >>that page, you don't see the new value of that innerHTML in the source.

    >
    >>Obviously, if it's HTML that is renderable in the browser, you will see

    >the
    >>rendered results of the new HTML in the browser window, but the HTML source
    >>code will not be contained in the source code for that page (it's only

    in
    >>memory?).
    >>
    >>Unless you somehow are able to view or "dump" the contents of memory (alot
    >>of work or know-how, no?), you will not be able to see the script.
    >>
    >>If anyone needs help getting this working, email me.
    >>
    >>Gary
    >>
    >>"Gary" <gchoma@invtitle.com> wrote:
    >>>
    >>>Sylvain-
    >>>
    >>>I discovered that when you use an include file, that file is downloaded

    >>to
    >>>the user's machin (in the temporary internet files folder for IE).
    >>>
    >>>I have yet to experiment with the innerHTML method in trying to hide script
    >>>code. I would need to write a server side routine that would read in

    a
    >>.js
    >>>file and output it to the clien (via Remote Scripting) where I could place
    >>>the code into the page:
    >>>
    >>>//assuming that a reference to a server-side object has
    >>>//been setup already with Remote Scripting, and a
    >>>//<div id="myDivTag"></div> has been placed in the HTML stream,
    >>>//the call would look like this:
    >>>myDivTag.innerHTML = aspObject.GetScriptCode();
    >>>
    >>>I'll have to report findings after I try it.
    >>>
    >>>Gary



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center