javascripthtmlsecurityjavascript-security

how to secure or hide my javascript code?


Is there anyway to hide or secure my javascript code. Because anyone can easily see my javascript logic on my website using view page source and it's harmful for me. Please tell me any method you know for securing the javascript code or for making it difficult to understand using any encryption method with cannot easily decrypt.


Solution

  • You can't. Don't put sensitive code, keys, information, or logic on the client. The only thing you can do is make it harder to read by running your code through an obfuscator.