[X]

Encrypted HTML

browser tricks 1999 partly

Protect your source by shipping it as percent codes, plus the one line that undoes it.

In 2026: Partly: the decoding still runs, the protection never did. Shareware tools sold HTML encryption that was escape() in a trench coat: the page became one big percent-encoded string and a one line document.write(unescape(...)) put it back. View source showed gibberish, which satisfied the buyer; the decoder shipped six characters above the gibberish, which satisfied everyone else.

Where it came from: Shareware page protectors of the late 90s, HTML Guardian and its many kin. Every one decoded itself with the function printed beside the cargo.
MDN unescape

<script language="JavaScript">
var protected_page = "%3Cb%3EMy%20secret%20page%3C%2Fb%3E%20%3Ci%3E(c)%201999%2C%20do%20not%20steal%3C%2Fi%3E";
document.write("<p style='font:13px Verdana'>What view source showed:</p>" +
  "<code style='word-break:break-all'>" + protected_page.replace(/</g, "&lt;") + "</code>");
document.write("<p style='font:13px Verdana'>What one unescape() makes of it:</p><p>" +
  unescape(protected_page) + "</p>");
</script>
sandboxed demo · breaks nothing but itselfrestart

More in browser tricks

all 30 in browser tricks › · the whole library ›