[Javascript] Encrypting JavaScript

Andrew Gibson andyg at ihug.co.nz
Thu May 15 15:12:34 CDT 2003


The other point of course, is that for someone clever, they may only want to
hack into and/or steal pages that ARE encrypted!

Someone one time did mention you could do something with session variables,
but no doubt there is some way around it.

Something like this I think it was:

In main page

<% session("canRead")="yes" %>
<script src="scr1.asp"></script>
<% session("canRead")="no" %>

then in the script page src1.asp

<%
   if session("canRead")="no" then
    response.end
   end if
%>
 // rest of jscript here

I'm all in favour of open source code, but I agree open source application
is a bit different!

You could follow a few guidelines maybe?

1. Dont keep scripts in separate libraries, eg  <script id=pageentry
src=scr1.js>  You certainly could keep them separate code design wise, but
then include them eg in asp  <!--#include ~~~  so the scripts are compiled
on the page together in one block.
2. Maybe do some kind of replace function to change your good english
function names, eg.  function mapPlacement()  could become  function
dsafffdasfdfas()  etc.

Andrew Gibson





Subject: Re: [Javascript] Encrypting JavaScript


> If one uses ColdFusion for a server-side scripting language then you can
> encrypt the entire .cfm document (which I also use for external .js docs
> by naming them .cfm and calling them from the script tag.) The truly
> wanting will still find a way to decrypt, but it's worth a try.





More information about the Javascript mailing list