AstroCrypto

Let's say you want to build a nice little static site but want some content on it to be protect so only some people can see it. This is a simple thing to do when the content is generated by the server, you can run authentication on the server and add data to the response as required, but if you want a fully static site with the simplest hosting possible you need to get a little more creative.

RQl3nmDW13Lh8FExOmZ/RVnc9t2lZyS3ijKa0sky6sMEPIzO2QC3Bds2hr52DkEJw9Y06YhlCFBXb8WBYzRuTR0sPiyyUVe0p0JfmTY0PiQfCAondubnerd7t5ObkfwwqX8MulV60a0i9CcANH6of7/eK3KhKeHeMxD2kpKi6u7gL5p8rwaa6+nsu+ZqbiDCDxI94kOXm4QwSO2stf3YbYYPC4rFmM2FHt5B3d7t7z8oar6PQA5XBtsmhF+dwQ2RIT8PMRckk20qVYb/uM7RyF17HQksFm763Mk72DLd9v33W8gkgibZ82p3xPArpFdx6sQ7Q9R2++TslxmsURr3gv4n92ynWNkpvfv09zjfeeKKD8zwEw02H37/dauco7KzJ2M3fFhZqEohupc2Gr48Xyj1VX7LJqDblDUCpDnmRf0VXyEInNEgzrNj0VcwbG7/VzDKul38ddRjR/ZLgWBJ0COkOFuKg792XUkXYjRIZMFow9aX6s0o1zZxHSq6ZSbvP0pVqA==
Content Encrypted

There are some caveats to this of course. First all the content and information needed to decrypt the contect (except for the password itself) is stored on the page. The code that decrypts it also lays out all the specifics of how it was encrypted leaving nothign to guess for a would-be ner-do-weller to crack it at their liesure. Nothing that needs to be truly secure should use this system.

So what is it for then? Nothing really, however the thought I had in mind when building it (besides just looking for something to use the WebCrypto API with) was to build a portal page for a home server. There are several things I'd like to run that have web-facing interfaces that can be accessed from outside the home network. I wanted to be able to create a page that would list those services for me but that was little more secure than a simple webpage, no need to give anybody targets to start prodding.

There is also a crypto-test page for testing the crypto.js file in the client. It was built to test my understanding of the underlying WebCrypto API before implementing it into the Astro middleware.