Obscuring Javascripts

This page gives you a simple means of hiding the source of your Javascripts from casual view without affecting the functionality of the scripts at the expense of making the script much longer. This works by "escaping" the text. Normally letters, numbers, and a few other characters are not affected by this but some minor additions and we can convert those characters as well to values that can be "unescaped" to return the original value.

Note that what this page is offering is not encryption because there is no decryption required in order for a browser to be able to execute the script. Instead we are just converting the script into a version less readable to visitors viewing the source and making the content of the script unrecognizable to web spiders.

Simply enter (or paste) the content of the javascript to be obscured (without the html script tags) into the top text field below and then select Obscure. An obscured javascript that will function identically to the javascript that you enter will appear in the lower text box.

Note that the text of your Javascript can be easily obtained by unescaping the contents (as can be done using the Clean button below). This means that the content is not very secure but it does at least add an extra step that would be thieves have to perform in order to steal your script.

This is a much simpler than the encryption offered by my HTML Source Encryptor but can be used in conjunction with that encryptor to make anyone wanting to steal the javascripts from your page source work harder for it.

The two scripts can be used together. You can encrypt javascripts with the HTML encryptor provided that you include the script tags around the javascript. One alternative for making your javascripts twice as difficult to steal is that you first obscure the javascript via the above obscurer and then use the html encryptor to encrypt the obscured javascript together with its surrounding script tags. As the HTML encrypted code is itself a javascript the other alternative is to first encrypt the body code with the HTML encryptor and then obscure the resultant encrypted javascript with the above obscurer.

Finally, let me remind you that these scripts do not stop people gaining access to your source. These processes just make it slightly more difficult for them to do so while at the same time perhaps encouraging people who otherwise would have no interest in your source to put in the effort to convert your source back into readable text simply because having encrypted/obscured it makes it look as if you think you have something worth stealing. This is particularly likely if you also try to interfere with the operation of their browser such as by disabling the context menu which draws attention to the fact that you don't want people looking at your source.


Felgall Pty Ltd accept no responsibility for theft of any data obscured with the Javascript on this page.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow