Member-only story
TUTORIAL
Hiding Your JavaScript Code from Prying Eyes: A Complete Guide
Protecting sensitive data in your web page

The goal
U2FsdGVkX1/7DNglflcflNX1NepqxK7hBWR8E7BW3ZYSrQ4a7/EuyFNJe2mVXZqb63/Ln0Jf93I+ZX3h7oT1ew==
This is our JavaScript file!
The above encrypted string is a JavaScript array, containing a list of words that our web page needs to use. This article will show how to easily generate this encrypted string, as well as to download and decrypt it to a variable in your web page.
Open to the world
Web pages and applications are hosted online, and generally, their source code is open for the world to see.
Any contents that a web browser renders can almost assuredly be accessible by a user through either the “view source” feature of the web browser or a developer inspector tool (i.e., the Chrome/Firefox/Edge Inspector).
While open access to web page and script source code are typically commonplace and expected, there may be cases where a need arises to protect somewhat sensitive data.