By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 3,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

¿How to encrypt JavaScript Code?

P: n/a
Any one knows how to encrypt javascript code... other way than escape()
and unescape() [not is encrypt but a way to protect source code ????

Jul 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Look up javascript obfuscation.
http://www.google.com/search?q=javas...en-US:official

Eduardo F. Sandino wrote:
Any one knows how to encrypt javascript code... other way than escape()
and unescape() [not is encrypt but a way to protect source code ????
Jul 11 '06 #2

P: n/a
Eduardo F. Sandino wrote:
Any one knows how to encrypt javascript code... other way than escape()
and unescape() [not is encrypt but a way to protect source code ????
None, you put your code on the web, it can be read.

--
Ian Collins.
Jul 11 '06 #3

P: n/a

Eduardo F. Sandino wrote:
Any one knows how to encrypt javascript code... other way than escape()
and unescape() [not is encrypt but a way to protect source code ????
There really is no good way to hide your javascript from those with a
decent knowledge of script and html. However, in some cases, you can do
things on the server using a script such as php rather than using
javascript on the client's browser. The viewing browser can not see the
php - it can only see the results of what the php does. Of course some
things can only be done by script on the browser. For example, some
input from the browser user may be needed to complete a script action.
However there is nothing to prevent you from using php on the server
for most things and also javascript on the browser for a few things
that php can not handle.

I always wonder why someone is wanting to hide script. I see very few
scripts that use really new and unique code. Most scripts are written
using standard code that has often been used in the past. The main
difference is how different sequences of code are put together to make
up the complete script.

If one can completely replace javascript with php, the php on the
server can not be turned off by the client as can javascript on the
browser. This could be important for those who present something
important that is best done by script and who do not want to risk the
small number of browsers with script turned off from seeing their
important message.

Jul 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.