Password protect a static HTML page

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • staticrypt

    Password protect a static HTML page, decrypted in-browser in JS with no dependency. No server logic needed.

  • Hi HN! Author of the tool here. Just woke up to a few emails pointing me to this thread. Thanks for the interest and added eyeballs!

    I'll answer some of the comments here and address the new opened issues during the day. To answer a few questions that seem common skimming this thread:

    - WebCrypto: I've been wanting to use WebCrypto instead of crypto-js for years now. It's been in my "Important but not urgent" bucket (since crypto-js should be secure too), the interface is different so I want to make sure I do it correctly and life happened, so I never got farther than drafts. Thank you for the PRs, I hope to get to it soon!

    - "static" means no server-side logic (not no JS): I first made StatiCrypt to solve my own issue of wanting to password protect an html page I could host on a static file host (Netlify, Github pages...). The whole point is to not have a server or DB, so we can't use Basic auth etc.

    As I write in the FAQ[1] I do my best to implement things correctly but I'm not a cryptographer - any feedback to make the tool better or more secure is very welcome!

    [1] https://github.com/robinmoisson/staticrypt#is-it-secure

  • PageCrypt

    Client-side password-protection for HTML

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • plaf

    Low profile markdown static website generator / template engine based on handlebars

  • Shameless plug, I did something similar in a markdown processor (which processes any folder with some markdown into an html website). You can either protect some of the pages, or the entire thing

    https://github.com/cfe84/plaf

  • y-webrtc

    WebRTC Connector for Yjs

  • Here's one w/ 100_000. Perhaps it's missing a couple zeroes.

    https://github.com/yjs/y-webrtc/blob/master/src/crypto.js#L2...

  • quaid

    A single-page webapp that decrypts text using only client-side JavaScript

  • Similar here: https://github.com/sowbug/quaid

    It works with a GPG-encrypted file. I figured that was safer than developing my own encryption format. As it is, any vulnerability in the decryption process is equivalent to a vulnerability in GPG.

  • html-vault

    Generates self-contained HTML files protecting secret text content.

  • portable-secret

    Better privacy without special software

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • oauth2-proxy

    A reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers.

  • cloudflare-pages-shared-password

    Demonstration of a static site hosted on Cloudflare Pages with HTTP basic authentication

  • My recent solution to this problem -- for an entire static site -- was to use HTTP Basic authentication with CloudFlare Pages: https://github.com/garrison/cloudflare-pages-shared-password

  • sasha.html

    A pure HTML+CSS+JS local application made to encrypt "very important images" IFYKWIM ( ͡° ͜ʖ ͡°)

  • I have a similar project called Sasha.html.

    https://github.com/dav1app/sasha.html

    The idea is to export any file as an HTML file with the data as an encrypted string hard coded within the HTML. This way, no specific software is required to decrypt the file, just open it on the browser, type the password and download or view your file.

    I built this to have a easy way to send encrypted files to any device and open it without having to install external tools.

  • SingleFileZ

    Web Extension to save a faithful copy of an entire web page in a self-extracting ZIP file

  • You can do the same thing with SingleFileZ [1] which can protect saved pages with a password. It relies on the zip specification to store encrypted resources.

    [1] https://github.com/gildas-lormeau/SingleFileZ

  • Keycloak

    Open Source Identity and Access Management For Modern Applications and Services

  • > The user experience with basic auth is not so good.

    Apache actually also has an OpenID Connect module, which you can enable to have it work as a relying party: https://github.com/zmartzone/mod_auth_openidc

    Basically, the actual UI will be handled by another system that you might be using, for example, in my case that might be a self-hosted Keycloak instance: https://www.keycloak.org/

    I'd say that Keycloak is a pretty good solution in general, because it does some of the heavy lifting for you, maybe its shorter release cycle not being the best thing ever, though. I think IdentityServer also tried to fill this niche, but they went full on commercial recently, without OSS offerings.

  • OpenID

    OpenID Certified™ OpenID Connect Relying Party implementation for Apache HTTP Server 2.x

  • > The user experience with basic auth is not so good.

    Apache actually also has an OpenID Connect module, which you can enable to have it work as a relying party: https://github.com/zmartzone/mod_auth_openidc

    Basically, the actual UI will be handled by another system that you might be using, for example, in my case that might be a self-hosted Keycloak instance: https://www.keycloak.org/

    I'd say that Keycloak is a pretty good solution in general, because it does some of the heavy lifting for you, maybe its shorter release cycle not being the best thing ever, though. I think IdentityServer also tried to fill this niche, but they went full on commercial recently, without OSS offerings.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts