Alex Rivera | Logout

How can I hide or encrypt JavaScript code?

Asked 2009-06-19T22:50:25.877
65

Is there any way to hide or encrypt JavaScript code to prevent people from viewing, copying, and/or modifying proprietary programs?

Edit
Report

2 Answers

5

One of the best compressors (not specifically an obfuscator) is the YUI Compressor.

answered 2009-06-19T22:54:08.070
2

The only safe way to protect your code is not giving it away. With client deployment, there is no avoiding the client having access to the code.

So the short answer is: You can't do it

The longer answer is considering flash or Silverlight. Although I believe silverlight will gladly give away it's secrets with reflector running on the client.

I'm not sure if something simular exists with the flash platform.

answered 2009-06-19T22:57:29.110

Your Answer