javascript: hiding contents of key

If var Speaker = "password"; is hardcoded somewhere in your client code, you are out of luck. See Password encryption at client side, and Howto hide Credentials in a pure Javascript HTML Web App and Is it worth hashing passwords on the client side because everyone will say not to hide/obfuscate a password on the client-side.


However, If you really, really just want to remove the password altogether from your client code, then use a server-side script to “proxy” your AJAX request and silently add the password as a POST parameter (for example) in transit to the true destination. See Angular REST API security


If you are adamant about using some kind of crypto on the client-side, I found angularjs-crypto which is an “AngularJS module for decryption/encryption of JSON in HTTP requests/responses”. It is based on crypto-js. I still strongly against taking a hardcoded password and encrypting it on the client-side, however.

Leave a Comment