I am currently working on securing my javascript code. I am using Asp.net 4.0 When i was checking my mail on gmail I just right clicked & selected view source & It just showed me <html><body></body></html>
. Can i implement this type开发者_如何学Python of security in my application or any other best security feature that will hide/encrypt my javascript code
No, short of obfuscating it, there's nothing you can do to prevent somebody from seeing your code. Even then, obfuscating it only makes it more difficult to interpret, not impossible. Javascript is interpreted by the client's browser. The only way for it to be executed is for the source code to be available to the browser at runtime. In order to "encrypt" it, you would need to then provide the encryption key to the browser which would defeat the purpose of the encryption all together.
精彩评论