-
Notifications
You must be signed in to change notification settings - Fork 1
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
Consider removing Diffie-Hellman operations with inverted keys #16
Comments
Based on the scheme above, one is able to move the message ID discovery to the client side, leaving the server in the dark about whether a keyholder can open 1 message or 20, which hardens the scheme against correlation attacks by a malicious server. It involves using the secret shared among three parties to encrypt the message ID, and sharing the resulting ciphertext along with the 2 party shared secret. An example implementation can be found here: https://gist.github.com/eaon/9e0b1f8bebd8cd64f6d625dac20ca590 I believe that this counts as a variation of an Oblivious Transfer, though I'm not certain and would appreciate a cryptographer's input to find a proper name for this. |
Thanks for the contribution, this is actually a breakthrough toward both establishing and verifying the security of the message fetching messaging, and by moving the final step on the client side, we remove the in memory visibility of messages fetched together from the server side, which was the main security concern at the moment. Here is a text summary of the improved protocol: Keys recapSourcelong term:
ephemeral, per message:
Serverephemeral, per request:
Journalistlong term:
ProtocolSubmissionSource sends:
FetchingServer calculates shared secret:
Server sends:
Journalist calculates:
Journalist can now query the server for individual message_id, without revealing message correlation. I will port this to a branch in this repo as well for testing purposes. |
Just noticed that on every other DH operation the secret key is on the right hand side except for here. Probably not confusing overall but maybe better to be consistent for the final documentation! Glad to be of help 😄 |
Fixed thanks! I have started developing in the branch https://github.com/freedomofpress/securedrop-poc/tree/improved-challenge-response I wanted to get rid of our custom ECDH lib wrapper that we modified to use the inverted keys, but it turns out python-ecdsa is not very friendly in doing cascades DH operations. On a side note, the new protocol removes the need of a lot of things:
|
improved-challenge-response now fully implements this mechanism bidirectionally. It was also very quick to plug'n'play in the architecture! |
I really like this approach! I will add some rationale/view from my prospective: In the initial challenge-response protocol, the Entities (Source and Journalist) were directly exchanging sensitive data (the encrypted messages). This required the protocol to hide this information to the Server, through the use of inverted keys etc. In @eaon proposal, an Entity that wants to submit a message:
an Entity that wants to read a message:
As for the name I wouldn't call it Oblivious Transfer since it is used to describe protocols that have some more cryptographic properties that this protocol doesn't provide. |
A great news now that inverted keys are not used anymore is that we can start creating formal proofs for the protocol. I've started modeling it with Verifpal. And the (heavily commented) model: |
Lovely to see this flurry of great activity in response to this!
I agree that it's not a traditional OT one as there really isn't a choice on the receivers end, but other than that, I find it best maps onto the description of k-n Oblivious transfers. Edit: also relevant: PIR but that talks primarily about 1-out-of-n, which the scheme above is obviously not… Staying with terminology for a moment, attestation strikes me as an odd choice for the name of the 2-thirds shared-secret that gets sent to the entity requesting a list of possible downloads. Do you have a rationale for using that term? I personally see the 2-thirds shared-secrets (i.e. the one sent by the sender, and the one sent to the receiver) as blinded public keys. On the sender side the blinded public key disguises the recipients identity from the server, and on the receiver side it prevents "passive" enumeration/tracking of particular messages. |
More terminology nitpicking… I'm not sure if challenge-response is the best way to describe this anymore either: clients can learn |
I agree, there is no longer a response as message fetching is not interactive anymore. Before updating the documentation and the paper we need to define things better AND be consistent around all the part of the projects (code, docs, paper). |
I agree that it totally looks like an OT, especially during Message Retrieval! Same thing about blinded public keys, see section 3 and section 4.1 of draft-irtf-cfrg-signature-key-blinding-01. I also agree that now the challenge-response terminology should indeed be changed. This could even cause confusion. Having said this, I'm down for whatever name we pick 👍 |
Same, really. I'll poke some more people who I believe could have good insights, luckily this is compact and "standard" enough to be communicated relatively quickly. Edit: my current preference of thinking about this is as ECDH and AEAD based Identity-derived-k-out-of-n Oblivious Transfer protocol. A true mouthful but potentially more correct and understandable? |
If we really want to name it, what about 3-party Oblivious Transfer ? IMHO that's the peculiarity of this protocol, since there are already (EC)DH and AEAD OT out there, and also considering that we do use AEAD algorithms but we never make use of AD for authentication purposes. WDYT? |
In the meantime, as part of code and Readme refactoring in light of these changes, I have dropped the challenge/response terminology in the whole source code (Readme is still in progress, it needs a lot of rewriting) and moved to a more generic and fitting "Message fetching protocol". I have also added a demo script that simulates a full server setup and an example of journalists/source submissions/reply flow with multiple parties. |
This is a brilliant and exciting development. Thank you, @eaon, for proposing it; @lsd-cat for implementing it so quickly; and @TheZ3ro for modeling it already! Not being able to model the original protocol was always an unfortunate smell for me, so this is a very encouraging smell indeed. :-) I'm very interested in the naming question here, which is to say the question of conceptually "What is this?" as opposed to mechanically "How does this work?" I'll think on that too. |
In case useful for anyone else, here are my "notes" from following this discussion and especially #16 (comment), attempting to answer the question, "What secrets are constructed and reconstructed from what?" https://gist.github.com/cfm/f27e60fa2f2d2a4db899499fd8d29737 |
Opened #17. I think it is worth merging as we are progressing towards a more established scheme. Beside the code, I have almost completely rewritten the README, not only to apply the latest development, but also by formalizing more the notation used and make it more consistent with the whitepaper and the charts. |
I've updated https://gist.github.com/cfm/f27e60fa2f2d2a4db899499fd8d29737#file-2-md with the diagram I (at least :-) needed to understand the asymmetry between decryption/recovery of the message ID and decryption/recovery of the message "envelope" retrieved by that ID. Everything prior in that gist is just sketches to get me there. :-) |
Re: naming: Is it possible that the two- and three-party layers of this scheme are worth naming separately, before naming their composition? The recovery of one or more message IDs from the server is both anonymous and oblivious. The server doesn't know who's requesting the set of message IDs or what subset, if any, any given requester will be able to recover. The retrieval of the message is anonymous but not oblivious. A specific ciphertext has been requested. Oblivious disclosure before anonymous retrieval? |
in 13c8a28 I think that the security guarantees hold even before, but I think that rotating keys as much as possible, especially if it comes at a low performance cost, should be done to reduce the attack surface. The code change is minimal, as the key generation is just brought inside the per-message loop on the server side. Nothing change on clients side.
I am starting to think that Oblivious Transfer could be appropriate for the |
It occurred me while I was away that one way of thinking about this application of an oblivious-transfer-like scheme is to prevent enumeration: by making it both (a) constant ( |
@lsd-cat, in #22 I've proposed adapting the useful iteration of https://gist.github.com/cfm/f27e60fa2f2d2a4db899499fd8d29737 into a supplemental document. |
Closing as we have merged the code, ported it to libsodium and merged documentation and diagrams. We also audited the protocol with these changes are are aiming at drafting formal proofs. Kudos to @eaon for the bright discovery and contributing it back. |
It turns out with the exact same protocol flow, and the exact same properties of who knows what when, the "Sealed Assurance of Secret-Key Possession" can be achieved with regular DH operations, no party has to invert keys to arrive at the same functionality. An example implementation is here https://gist.github.com/eaon/aa46e54ae34aaf98cb670fba41c0647c
A quick summary: instead of using the "public key" as the "assurance", which requires information to be removed from a shared secret, the shared secret between three parties itself can act as the assurance.
The text was updated successfully, but these errors were encountered: