Show HN: 100% offline Shamir's Secret Sharing GUI
simon-frey.com
simon-frey.com
"To enable CSP, you need to configure your web server to return the Content-Security-Policy HTTP header (sometimes you will see mentions of the X-Content-Security-Policy header, but that's an older version and you don't need to specify it anymore).
Alternatively, the <meta> element can be used to configure a policy, for example: <meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src https://*; child-src 'none';">"
It would be amazing if there was a property you could add to the <html> tag to enforce that the browser would prevent any network access or disk writes.
As it stands I think after you save the files, you would have to look into each .js file downloaded as part of the bundle to check for outgoing network requests?
The code is tiny except for vue_debug.js which is 193KB.
Yes; there is another js Shamir utility that works like that; it requires you to download the html and refuses to run unless it detects that you are offline. :-)
They could just display the "please disconnect" error for a while, then sneakily stop checking after some date, collecting data every time you forget to disconnect. You'd need to check the code, or never forget to disconnect - the latter is probably a mistake waiting to happen.
Chrome bug page for "offline-only PWAs" if you want to star it: https://bugs.chromium.org/p/chromium/issues/detail?id=995236
Suddenly I'm thinking it would be very cool to be able to right-click on a tab and say 'Take Tab Offline' Imagine if it was like a toggle on the tab itself like muting sound from a tab. It would instruct the browser to isolate the tab/process from the network? I'm not sure how Web Workers play into this.
I'm talking about the meta tags. It would be neat to have a toggle on the tab for isolating the content of the page from the network.
If you have a use-case, or some ideas, there's Chrome bug page for "offline-only PWAs": https://bugs.chromium.org/p/chromium/issues/detail?id=995236
`Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:8080/wasm/wasm.wasm (“connect-src”).`
For now I only added `default-src: 'self'; form-action 'none'` to the index.html
This allows to set `connect-src: 'data'`
A more concerning gotcha is that this scheme doesn’t produce verified shares (i.e., shares lack integrity). An adversarial or forgetful share holder can submit a bad share and within this scheme, you’d have no way of being able to prove that they did this. All any of the participants would know is that the resulting secret is wrong, whatever that means for the application (e.g., the AES key doesn’t successfully decrypt a ciphertext).
Or even better: If you got some time spare, feel free to help out with s4 :D https://github.com/simonfrey/s4
You could also use digital signatures on the shares to get integrity for individual shares.
I also believe that also in theory, using SSSS + fixed-size symmetric keys gives you all the same security properties of SSSS and no leaking of the message length, assuming that the symmetric cipher you're using is secure. What exactly do you mean by "this isn't usually an issue" (emphasis is mine).
Or am I wrong here?
https://en.wikipedia.org/wiki/Category:Information-theoretic...
The idea is that there is no amount of computational capacity or mathematical insight that could permit an attacker to break this algorithm, even in principle. That contrasts with other primitives which are often insecure given an efficient P=NP solution (guess the right answer and check that it was correct). With the one-time pad and Shamir's Secret Sharing, the attacker has no meaningful way to check whether the guessed answer was correct or not.
(Both algorithms have a requirement for random input, and the information-theoretic security argument assumes that the attacker could never predict any information about your randomness source, which might not always be true if you're running on real hardware. If you're driving the algorithm with the output of a CSPRNG, the information-theoretic security may reduce to the security of your CSPRNG, which is not information-theoretically secure, for example because an attacker who could somehow guess the CSPRNG seed and offset could potentially confirm that this guess was right.)
Another way of thinking about this is the a brute force attack on a security system requires a way to detect when your current guess is right. This is why, for example, the RSA encryption challenges would always have a plaintext starting with "The unknown message is:". This assumption isn't necessarily that unrealistic if you know that the plaintext of an encrypted message is a particular file format. Apparently a huge amount of military cryptanalysis, once governments started building special-purpose hardware for brute-force-like attacks, consisted in trying to find and refine ways to usefully detect when the attack had succeeded, given relatively great uncertainty about the nature of the plaintext. It also appears that many of those plaintext-recognition ideas are still classified (!).
In an information-theoretically secure algorithm, there is no way to detect a successful break of the algorithm because all plaintexts are equally possible and equally likely given only the evidence of the ciphertext. That means that the ciphertext itself doesn't contribute any new information about the plaintext, so there's in some sense nothing to worry about from sharing the ciphertext with an adversary.
Edit: Added
It needs to be accompanied by a system that ensures everything is still in tact. The system would ping every key holder every X months and have them prove they are still in possession of their key. If a problem arises the wallet owner is alerted to deal with it. Otherwise she gets an all clear report.
The annoying thing tho is now there is a centralized 3rd-party database of all your key holders. Part of the security is nobody knowing who's in on it. Imagine a wallet with $100M. That database starts becoming valuable. So the service would have to be zero-knowledge or hosted, but now you're hosting stuff, and not just any stuff, the most valuable stuff, requiring top security.
One Shamir vs multisig article : https://medium.com/clavestone/bitcoin-multisig-vs-shamirs-se...
Provides additional security against key loss or malevolent actors at the cost of having to wait it out when such things occur.
FYI the whole page breaks if you accidentally delete the "shares" value or type 0, requiring a refresh to revive it.
Edit: Fixed
I'm also seeding this on Beaker. hyper://467f73aff5af260ab04a4f064fa8cd7fda6f23fed4ff227bc29514c3381a2087/
Beaker Browser https://beakerbrowser.com/
which uses Hypercore Protocol https://hypercore-protocol.org/
IDK what Beaker is exactly, but the nice thing about IPFS is that this hash is guaranteed to correspond to this commit: https://github.com/simonfrey/s4/commit/1d169cb33761b57569e52... - it can't be modified (by me or anyone else) in the future.
While Beaker does let me update the source code at that location - you can also link to the current version permanently by adding the version number (46, in this case) to the end.
hyper://467f73aff5af260ab04a4f064fa8cd7fda6f23fed4ff227bc29514c3381a2087+46/
Reminds me of something similar: https://iancoleman.io/shamir/
http://ipfs.io/ipfs/QmZqRpnRgvBPbP65pdyD2fYhDh9VDEW4EGb5kM41...
The above mentioned 1000+ share problem could only be solved by a limit, but I would be in favor of not limiting users here.
p.S. On firefox it only chrashes the tab
Also, I vaguely recall that results may be implementation specific, in that shares must be combined with the same app that produced them. So is this implementation compatible with others?
Sort of. Different apps may use different finite fields. The math should be the same as long as you’re computing everything modulo the same integer. It is also possible that some apps may encode shares differently. For example, I’ve seen some apps base64-encode each share where others keep them as integers.
Edit: Fixed together with other spelling mistakes
Edit: Fixed
Will check how to solve this :D