Live data from Hacker News

Password protect a static HTML page, decrypted in-browser in JavaScript

github.com

1–10 of 48 posts

Re: Password protect a static HTML page, decrypted in-browser in JavaScript

#2
> returns a static HTML page showing a password prompt that you can now safely upload anywhere

Anywhere that you trust, and where the page is hosted securely. For example, a malicious hosting service could alter the password prompt. Or the page as a whole could be put in a frame with a transparent overlay.

Re: Password protect a static HTML page, decrypted in-browser in JavaScript

#5
post #4
post #3

This is what I'm looking for: a way to put something in public (I'm using Vercel) that "only" me can access (anybody who can decrypt it doesn't need the content that I encrypt).

Just encrypt it with Age?

This https://age-encryption.org ?

Re: Password protect a static HTML page, decrypted in-browser in JavaScript

#6
post #3

This is what I'm looking for: a way to put something in public (I'm using Vercel) that "only" me can access (anybody who can decrypt it doesn't need the content that I encrypt).

So you're looking for an authentication and authorization system.

Re: Password protect a static HTML page, decrypted in-browser in JavaScript

#8
post #2

> returns a static HTML page showing a password prompt that you can now safely upload anywhere Anywhere that you trust, and where the page is hosted securely. For example, a malicious hosting service could alter the password prompt. Or the page as a whole could be put in a frame with a transparent overlay.

Clickjacking has been a solved problem for over a decade. Set X-Frame-Options: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-...

Re: Password protect a static HTML page, decrypted in-browser in JavaScript

#9
post #8
post #2

> returns a static HTML page showing a password prompt that you can now safely upload anywhere Anywhere that you trust, and where the page is hosted securely. For example, a malicious hosting service could alter the password prompt. Or the page as a whole could be put in a frame with a transparent overlay.

Clickjacking has been a solved problem for over a decade. Set X-Frame-Options: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-...

Hence the need for a hosting service that you trust. You can't force that header on an untrusted server.
Post reply on HN