How to secure our jquery code in Asp.net MVC.
How to hide javascript code of Asp.net MVC from inspect element of every bowser
Secure our jquery code in Asp.net MVC :1. Minified code can be see in proper format in any browser, javascript is a client side script so you can't hide it from the client but you can make it hard for them to read it. you can obfuscate your script but still others might be able to decipher it.
2. You could probably opt for minification with gzipping. Bundling... minification is a kind of encryption for the query cause it cannot readable. And use encryption for your parameters and decrypt them in controller.
You can minify it, but you can't hide it. The browser has to have the javascript code to run the page in the browser.
Create separate js file and add a reference to the page.
3. If you're using the bundle feature in ASP.NET 4.5+, it can minify it for you automatically. The script file is still visible to the browser, whether it is in a separate file or embedded in the page. I can bring up the console in Chrome or IE and look through all the script files - I do it all the time for debugging purposes.
4. Don't put anything that could compromise the security of your application in the Javascript and you don't need to worry if people see it or not.
No comments:
Post a Comment