5 ms·
Show HN: html-vault – create self-contained HTML for password protected content
- eitland 7y agoThis might take a moment it said but I think I waited two minutes with no result in sight.
- bmsleight_ 7y agoWorks, but takes a little while. Nice -useful
- dividuum 7y agoThat's very much by design. The idea is that even if the file is stolen, a good password should still protect against a lot of bruteforcing.
- mc3 7y agoBy design? Or running code in the browser is inefficient? (not your fault, that's the way it is) Keepass (Desktop app) for example doesn't take ages to open.
- brokensegue 7y agoYou can configure keepass to take forever to open.
- dividuum 7y agoYes: By design. This helps make brute forcing the password harder by forcing each attempt to take a while. The crypto implementation in the browser itself is pretty fast. You can easily make it faster or instantaneous by lowering the number of PBKDF2 rounds in the html-vault script. The default of 20 million seems a bit excessive based on the feedback so far.
- camsjams 7y agoNice! I made something similar to this: https://github.com/camsjams/mr-roboto https://github.com/camsjams/mr-roboto With a slight difference, it works 100% in the browser, you can use it here: https://camsjams.github.io/mr-roboto/ https://camsjams.github.io/mr-roboto/ But you need to store the output somewhere safe.
- dividuum 7y agoNice. I guess the big difference is the key used for the symmetric encryption. I'm using PBKDF2 to derive the final key to make it harder to brute force in case you get the HTML file.
- aurorabbit 7y agoOn the topic of toy web crypto projects, here's mine: https://emojicrypt.com/ https://emojicrypt.com/ It offers scrypt + aes-gcm, encoded into 256 emoji; all the crypto is in https://github.com/aurorabbit/libemojicrypt/blob/master/protocol.1.js https://github.com/aurorabbit/libemojicrypt/blob/master/prot... (I could have went without a subrepo, but in theory it makes non-web integration or alternate interfaces simple.) It's based off of ricmoo's scrypt.js, pfrazee's base-emoji, and WebCrypto. Output contains a header (with N/r parameters), salt, IV, and HMAC. Room for a dozen more protocol versions as well. It's abandoned, looking for a loving home! Work for some new (and some unimplemented) features is laid out here: https://github.com/aurorabbit/emojicrypt.com/issues https://github.com/aurorabbit/emojicrypt.com/issues
- deleted 7y ago[deleted]
- aurorabbit 7y ago:bangbang::penguin::bomb::rabbit2::pig2::black_joker::pray::flashlight::baby_bottle::herb::cookie::arrow_right::loudspeaker::ribbon::ice_cream::fries::link::thought_balloon::1234::rose::point_left::sunglasses::open_hands::game_die::nose::cactus::cake::beetle::musical_keyboard::football::musical_note::point_up_2::ox::dash::no_entry::crown::postal_horn::no_entry::broken_heart::vertical_traffic_light::baby_bottle::ghost::snake::round_pushpin::art::bath::rice::sweat_drops::point_up_2::rocket::postal_horn::gun::traffic_light::tennis::poodle::bath::couple::octopus::maple_leaf::earth_africa::shell::pushpin::rabbit2::sweat_drops::point_right::ghost::hamburger::blue_book::telescope::arrow_right::rooster::purse::beer::flashlight::sob::bride_with_veil::ring::bomb::cupid::pray::bowling: The password is the FQDN of hn (without the final .)
- dividuum 7y agoNice. Did you measure the performance of scrypt.js? The PBKDF2 implementation in Python and both Chrome/Firefox are similar for me and the Python documentation states something like 3x slower that the OpenSSL implementation [1]. So it sounds pretty usable to strengthen the password while still being usable. [1] https://docs.python.org/3/library/hashlib.html#hashlib.pbkdf2_hmac https://docs.python.org/3/library/hashlib.html#hashlib.pbkdf...
- maxlaumeister 7y agoHey! I also made something similar to this (uses a password-derived key to create protected, self-contained HTML). https://www.maxlaumeister.com/pagecrypt/ https://www.maxlaumeister.com/pagecrypt/ Mine was originally in-browser, but thanks to some contributors (Zoltán Gálli and Nial Francis) it has Python and PowerShell CLIs now. I like your use of async to make sure the work stays off the main thread.
- Tepix 7y agoI like it! Works well. Do you see a way to reduce the required code?
- maxlaumeister 7y agoI just glanced through it again, and it seems to me that aside from styling, every section of code fulfills an important purpose. But it could definitely benefit from being more broken out into components and library-like, so that the only code surfaced in index.html is the UI code.
- Tepix 7y agoLooks like your code predates the Web Crypto API, so switching over to that should get rid of more than half the code. Right?
- Tepix 7y agoIt took way too long on my laptop (i5-6200U). With a decent random password (say, 14 letters), the search space will be very large. If a determined attacker (with a couple of GPUs) can attempt 100.000 passwords per second it will still be impossible to crack in an acceptable time. If we assume that this determined attacker is calculating these hashes 100.000 faster than the average browser, it should be enough if the user has to wait for one second, not one minute. On the other hand everyone has different security requirements so perhaps making it configurable is the best way to go proceed (with some recommendations). PS according to https://github.com/analsec/hashcatbenchmark/blob/master/Nvidia/rtx_2080ti.txt https://github.com/analsec/hashcatbenchmark/blob/master/Nvid... a RTX 2080Ti can crack 750k WPA-EAPOL-PBKDF2 with 4096 rounds per second.
- sowbug 7y agoSimilar: https://github.com/sowbug/quaid https://github.com/sowbug/quaid
- dividuum 7y agoIndeed. The project motivation is even similar to mine (bootstrap yourself in case everything gets lost). I guess the main difference between the two is that I tried to make the generated HTML minimal so it's easier to verify before entering a password.