'; document.writeln(my_chunk); } } // --> --> Javascript-snippets : Lines of Defense Against Code Theft
Javascript Noteblock


Lines of Defense Against Code Theft


(Beginners only !)
fished from the web


Many clever "tricks" have been invented to counter the code plagiarism. I'll describe some of them which I've learned from the net. Depending on the value of your script, one or the combination of these methods may be sufficient.
  1. Insert a full page worth of empty lines so a "view source" window will be blank initially. However, one can easily scroll down the window to see the rest of the script.


  2. Launch the application from a "welcome" page. Disable the menu bar so people can not view the source of current window. However, one can always find out the URL for the application and by-pass the welcome page. This trick will not work in Communicator because of accessibility to "view-source" window through pop-up menu.


  3. Create a hidden frame (width = 1) and load your code into that frame. You'd have to refer to the functions and variables using frame name. Again, one can always find out the URL and by-pass the frame window.


  4. Put the code in a server-side include file with "js" extension. Include the code in the script using <SCRIPT SRC="test.js"> . . . </SCRIPT>. Though "js" file can be downloaded from server by itself, thus expose the code.


  5. Write your code in such unorganized way that nobody else can read it. On how not to do this, please refer a great article from Danny Goodman. The down-side here is that you may not be able to read it either after a while.
  6. Approaches involved code pre-processing

  7. A simple program can remove all comments and pack the code as a long line. It'd take a dedicated person of restore the format, but it can be done.


  8. Use escape sequence for string literal. Convert them back on the fly when executing the script. Combining with code packing, this can be quite effective.


  9. Map the function, method and global / local variable names to some randomly generate unique tags. Because the keys are not known even to the original author, it is not possible to revert these randomly generated names to their original, human readable names.

Page started by The Seeker
Page created: 06 November 1999

Logo

choose your way out:

redFravia's (frozen) homepage redThe Seeker's homepage redThe javascript workshop redWhat's new