Sitemap
JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Member-only story

TUTORIAL

Hiding Your JavaScript Code from Prying Eyes: A Complete Guide

Protecting sensitive data in your web page

7 min readMar 1, 2023

--

Source: Stable Diffusion.

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.

About that sensitive data

--

--

JavaScript in Plain English
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Kory Becker
Kory Becker

Written by Kory Becker

Software Developer. Artificial Intelligence. Quantum Computing. Machine learning. https://primaryobjects.com

Responses (2)

Write a response