-
-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension for encrypting an entire website #120
Comments
this would be nice to have because i tried folowing your steps and failed |
Here's a gist with the code I created for this, if it helps: https://gist.github.com/epicfaace/c1a4452401af14d35b60fe211f2c1559 |
Thank you I'll have a look at this an see if I can get it to work |
@epicfaace Thanks for your wonderful sharing, the idea helps a lot! |
Hey @epicfaace, thanks a lot for the detailed suggestion and my sincere apologies for taking so long to answer. I think the feature is a good one. Regarding the use case, it feels to me the main one would rather be browser dependent than "choosing between localStorage and sessionStorage at encryption time": if I access the page from my personal computer I might want to stay "logged in", if not it might be better to ask the password for each page. So that's what I implemented in #124 (along with a way to logout and expiration handling).
Regarding the storage in clear text I feel on the same page as you are (I think): it's not ideal, it might be okay-ish here. Thinking out loud, here are some threats I think it might enable:
I don't really see a way to get the localStorage content that would not also allow reading of the page decrypted in browser (though there might be), so my assumption would be that the content of the page is compromised and what might be protected is the passphrase the user typed. A mitigation I had in mind was salting + hashing the passphrase and store that in localStorage, so the hashed passphrase effectively becomes the key to the encrypted page. This doesn't mitigate the leaking of the hashed passphrase, which allows decryption of the page, but does mitigate password reuse. #124 first draft has clear text passphrase storage. |
Staticrypt is great! I extended it a bit so that it could be used to encrypt an entire website. Here are my steps:
@robinmoisson would you be willing to accept PRs to modify staticrypt so that it can work with these kinds of workflows more easily? Essentially, staticrypt could then work out-of-the-box to let people easily deploy a password-protected github pages website (or, really, any static website).
I'm thinking of updating the staticrypt CLI options with the following parameters:
Then, generating a static site and deploying it to GitHub Pages might be as easy as doing the following:
npm run build # generates files in `dist` staticrypt dist -i -p localStorage gh-pages -d dist
Some potential improvements:
--logout-url
that allows a logout page to be generated; the user can then link to this logout page on the static site which should clear the password from the user's localStorage / cookies.Related to #110, #114.
The text was updated successfully, but these errors were encountered: