Obfuscate Code

Obfuscate Code - ApexCreate

Obfuscating simply makes code hard for others to read and follow. This is not to be confused with encryption which uses ciphers and keys to make the data unreadable to users without the correct information.

In this section we’re talking about obfuscating javascript code. So why and when do I need to obfuscate my JS?

Obfuscating certain snippets of your code will help make it difficult for potential hackers to reverse engineer your site and find security potholes. It can also be used to help prevent people from stealing and editing your code (as it’s often not worth the hassle).

There are down sides to obfuscating code. Depending on the level of obfuscation it may introduce a performance hit on your site. Lower level obfuscation, like variable name randomisation doesn’t add a performance hit, as computers don’t care what variables have been called, however encoding numbers and strings will.

Clearly we don’t want to to slow our site down anymore than we have to, so we recommend only obfuscating code that contains site logic, and simply minify other code like javascript plugins.

 As mentioned earlier the need for obfuscation depends on you and your site. If you decide that your site does require obfuscating then here are a couple of online tools to help you http://javascriptobfuscator.com/ and http://www.jsobfuscate.com/

 

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18