News for hackers. Stuff that matters.
Re:Password protect a static HTML page by Gordonjcp on Saturday February 18, 2023 @05:12PM (#34851643)
I thought that too, but this appears like it works to password protect an html file that's *not* being served off a server. This ought to work with a file on disk too.
Re:Password protect a static HTML page by userbinator on Saturday February 18, 2023 @05:41PM (#34851863)
The more general solution is to use a password-protected archive.
Re:Password protect a static HTML page by doodlesdev on Saturday February 18, 2023 @08:06PM (#34852983)
But then it's not self contained and every time you want to access the archive you also need a program that can decrypt/encrypt that format. Using a self-contained HTML file means it's currently the most portable way to encrypt something and have it available anywhere you can get the file on.

By the way, I don't advocate for this idea. But still, I find it a pretty ingenious way to store encrypted data portably. Essentially what is happening is the file contains the encrypted data and the algorithm to decrypt it with the correct passphrase/key.

Re:Password protect a static HTML page by chii on Saturday February 18, 2023 @11:58PM (#34854603)
> you also need a program that can decrypt/encrypt that format

that's just a self-extracting archive, which is a very common idea and easily created as well (very popular with both shareware distribution).

The problem is that you have to trust the extracting code to not install anything else malicious. The browser provides the perfect sandbox - you cannot install malware into the system via javascript in the browser, and thus you can trust it to run.

Re:Password protect a static HTML page by efreak on Tuesday February 21, 2023 @03:31PM (#34886715)
And you have to trust that running processes on dish aren't going to make a copy of it. Or that it won't end up stuck in the cache. This is (theoretically) only decrypted in memory (your browser may save a preview image of the tab, I believe Firefox mobile does this, not sure about desktop browsers)
Re:Password protect a static HTML page by efreak on Tuesday February 21, 2023 @03:34PM (#34886759)
Also, your self-extracting archive isn't platform independent, and likely can't be used at all on mobile platforms (iOS, Android) that don't offer to trying anyway files ootb (and are probably the wrong architecture anyways)