简体   繁体   中英

Regarding Encrypted Javascript

when we write javascript in web page then other user can see that javascript and understand how the script work. i have seen few site where javascript was written in such a way user can read the script but will not be able to understand how it works. so for the security reason how can i encrypt my javascript in the page where browser can understand & render properly but any user may not be able to understand the flow. looking for your suggestion.

thanks

This process is called obfuscation , not encryption which is not the same. It means that it makes it hard to read the code but not impossible.

There are many tools allowing you to achieve this such as:

If you use a JavaScript library but still want to obfuscate the entire code base to protect your IP, you can consider the Dojo Toolkit which is compatible with Closure Compiler's Advanced mode. Of course, you can also use the Closure Library, but in general Dojo is much more popular than the Closure Library (outside of Google, that is).

http://dojo-toolkit.33424.n3.nabble.com/file/n2636749/Using_the_Dojo_Toolkit_with_the_Closure_Compiler.pdf?by-user=t

Completely obfuscated code has exactly the same behavior as plain-text code, except that it is much smaller, runs much faster, and almost impossible to reverse-engineer, even after passing through a beautifier.

Code that is only "minified" (eg YUI compressor, Uglify) can be easily reverse-engineered after passing through a beautifier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM