Re:Password protect a static HTML page
by pyrolistical on Saturday February 18, 2023 @01:12PM
(#34849345)
Their solution intends for the static file to be copied offline
Client side decryption has the benefit that no machine or router in the middle can view or cache the decrypted page without the password.
Re:Password protect a static HTML page
by tptacek on Saturday February 18, 2023 @01:56PM
(#34849849)
You mean, unless they tamper with the Javascript to capture the password (or the derived key).
Re:Password protect a static HTML page
by dividuum on Saturday February 18, 2023 @03:00PM
(#34850458)
I designed a similar tool with that threat model in mind: the resulting HTML/JS is as minimal as possible so it’s possible to inspect before entering the password. Of course assumes safe browser and client machine.. https://github.com/dividuum/html-vault
Re:Password protect a static HTML page
by viraptor on Saturday February 18, 2023 @09:37PM
(#34853647)
Kind of possible. With enough content, would you actually spot a "}; and some highly obfuscated code in the middle of the blob? (My guess is a no)
Re:Password protect a static HTML page
by dividuum on Tuesday February 21, 2023 @11:08AM
(#34882702)
You're right. Probably not. But at least the chance exists as there isn't a multi-KB obfuscated JS dependency somewhere that would be a lot harder to handle.
Valid if you actually host the file online. Local files are generally not allowed to make requests. Not sure if local storage methods are usable without http/s.
Re:Password protect a static HTML page
by hosteur on Saturday February 18, 2023 @01:11PM
(#34849335)
Wow I like that. So simple and elegant. Could be combined with a username to produce unique urls per user.
Re:Password protect a static HTML page
by pyrolistical on Saturday February 18, 2023 @01:14PM
(#34849370)
A miss configured http server that allows directory listing would compromise everything.
Also now all intermediate things that have access to the hashed url would suddenly have access to a secure piece of information.
Don’t be clever with security
You can always put an index.html to prevent that mistake.
Re:Password protect a static HTML page
by madduci on Saturday February 18, 2023 @02:05PM
(#34849952)
A more lightweight solution would be to let the Webserver (nginx, https, whatever) password-protect the site.
No JavaScript required a d highly efficient
Re:Password protect a static HTML page
by fragmede on Saturday February 18, 2023 @02:21PM
(#34850135)
Requiring some sort of VM or container to run this webserver on? Is it possible that's way more onerous than a static html file which can be emailed around? Are you sure nginx is even going to be around in, say, 15 years? (think password protected PDF but in html and allowing for JavaScript.)
windows.location = hash(password);