Password Protect Static Sites with PageCrypt
Blog post from Render
PageCrypt is an open-source library designed to securely password protect static sites without requiring backend code, using the Web Crypto API supported by major browsers. It encrypts an HTML page, prompting users for a password to decrypt and view the content, but requires inlining of CSS, JavaScript, and other assets within the HTML for comprehensive protection. PageCrypt supports only a single shared password and does not offer individual user authentication, making it suitable for projects with basic security needs. Additions such as "magic links" allow easier access by embedding the password in a URI fragment, which isn't sent over the internet but remains in the browser's history. While it presents certain limitations, PageCrypt can be integrated into static site build processes using tools like Webpack, Gulp, or Grunt, and offers a simple deployment on platforms like Render.