Skip to content
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

Key exchange update #35

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion diagrams/key_exchange.drawio
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile host="app.diagrams.net" modified="2022-07-12T05:02:59.309Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36" etag="9Thzvw0-MVdKURfvbQUH" version="20.0.4" type="device"><diagram id="kcIGn_kX_1L25iIxUXLg" name="Page-1">7Ztbk6I4FIB/jY9NAQHER7V1pmpmtpyxtnZnX7bSEDHbSJwQu3V//SaQyCXeuhsvvY0vwiHkcs6Xk5MDdMBwsf5E4XL+jYQo7thmuO6A+45tW65n8j8h2eQS37dzQURxKAsVgin+F0mhvC9a4RCllYKMkJjhZVUYkCRBAavIIKXkuVpsRuJqq0sYIU0wDWCsS//AIZvLUbhmIf+McDRXLVumvLKAqrAUpHMYkueSCIw6YEgJYfnRYj1EsVCe0kt+33jP1W3HKErYKTeM/ur/Ci3/23eKP7PRl4ffwff+nevk1TzBeCVHLHvLNkoF6SNigRiL2QGDJcEJQ3T0xFsVqrW4bDsycRLCdI5CWXrOFrEqxCh5REMSE8olIZrBVcz7PYjhA4onJMUMk4RfCZCon194QpRhboivtQIPhDGyKBXoxzgSFxhZcilZsRgnvCHFg+gHlEW2lfMuL8XwFutIcGuQ2QwHyEhRsKKYbYxHtPl7iegCpylvlQ90MMNxrHrfsUF3POg73IYDDh6DvEEqx0mWMOA18DNXtDzjl6dSlztMJkViKGhdEkkTfkJkgRjd8CLyqq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yDWnBWDx4WOAzjfc8iq2bfvzQ3YqUq+q59Wk4ZnM1Gjef7uHLoRnhHyzAtdf4z85aO6ytB4SOzs035bIIo5qPL8qwH9Z77oyY854VSjTUH69af3Z+cZKy//3eip27MmTaeIdpSc2captltuTkUwr2aG+DU3I9vGqDbK34XpUhpp0TR5NtUZaHM6RyKpaJNJZySShiPzYaWKKfrVaMz78p5BFd/fbTF5OqYeJZ7Y5job6aVMpZaxpviJ8hQp015vzxfWfu4oQmf49lGFSfX7inJ1YDS85d7n5+0NL36AUrzNHnAuTmW9K1wi0mTX1idIfBpP6qqfbSxOwBrKb5s4GX5XePWQq9T0gEXSMsXGYc3f6gkB3A0U3DrHzQdrUj7ymFPLuG4M+GnxXfMefHia3Aw+g8=</diagram></mxfile>
<mxfile host="Electron" modified="2023-09-06T20:20:30.037Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.2.3 Chrome/102.0.5005.167 Electron/19.0.11 Safari/537.36" etag="5nnnjiDcUuiNZAazsxjc" version="20.2.3" type="device"><diagram id="kcIGn_kX_1L25iIxUXLg" name="Page-1">7Ztbk6I4FIB/jY9NAQHER7V1pmqmq5y19jL7spWGiNlG4obYrfvrN8FELlGxu/HS2/giHEIu53w5OTlABwwX6y8ULucPJERxxzbDdQfcd2zbMnuA/wnJZivxXCmIKA5loVwwxf8idaeUrnCI0lJBRkjM8LIsDEiSoICVZJBS8lIuNiNxudUljJAmmAYw1qW/45DNt1LfNXP5V4SjuWrZMuWVBVSFpSCdw5C8FERg1AFDSgjbHi3WQxQL5Sm9bO8bH7i66xhFCTvlhtGf/X9Cy3/4QfFXNvr2+Cv40b9znW01zzBeyRHL3rKNUkH6hFggxmJ2wGBJcMIQHT3zVoVqLS7bjUychDCdo1CWnrNFrAoxSp7QkMSEckmIZnAV834PYviI4glJMcMk4VcCJOrnF54RZZgb4nulwCNhjCwKBfoxjsQFRpZcSlYsxglvSPEg+gFlkV3lvMtLMbzFOhLcG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SDnhHacyGDXPrUohyxtcOJf3esNhY/tIldlWrwTtSSXtXkubl19WO5cbdzWVT0V0JJKs9mSoqZ+PlB2L+OSit2cd1IKzavCwwGEYH3oYWTb74aW5ESuV0Xft05LK4Gw2ajzhx5VDN8I7WoZpqfOfmbd0XF8Jch+ZnW2KZxO+SeWjyxKtR/W+9UdNeM4L5RorDtatPr4/OctYff/vRE/dmDNtPEG0o+bONEyz23JzLIR7MzfAqbgf3zRAt5f/LkqR0k4xwfAwVSkoczqHYqloUwmnpBLGY7OhJcrpeuXozLtyHsHd8/poi8m1MfEs98Yw0V9OU+lKLddN8TNkqNMmu1+frKx82dCEw/Fso8ySa/eU5Go06cnLI89OWp7e/PCkeZ484NwcTfpOuMWkyQ+szhD3tN9UVT7b2B9/tRRfNu6y/K5xa5HXKdmAC2Tl84TDuz9VkgOoTRTc+idNtRVpXzkcSCXUOxN+mn/GvC2efwwORv8B</diagram></mxfile>
1 change: 1 addition & 0 deletions diagrams/mpc-encryption.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2023-09-06T19:14:04.183Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.2.3 Chrome/102.0.5005.167 Electron/19.0.11 Safari/537.36" etag="4mVY3mnT_2M1H0Z3yH2e" version="20.2.3" type="device" pages="2"><diagram id="cXJQAhfcsM0mhUN3nRq7" name="encryption">7VhNc5swEP01PjoDCLBzjJ04mUk7zUw67VkBGTQViArZxv31XUB8CHBiJ6ZtOjkZrcRKfu/tatkJWkbZrcBJ+Jn7hE0sw88m6HpiWSYyLfjJLfvSMpuj0hAI6qtFjeGR/iLKaCjrhvok1RZKzpmkiW70eBwTT2o2LATf6cvWnOm7JjggPcOjh1nf+p36MiyttjtvTdwRGoRqa4QMdfIIV6uVIQ2xz3ctE7qZoKXgXJZPUbYkLEevAqZ8b3Vgtj6AILE85oWfm9VX90uQXQZLL7uPYuM6nk6Vly1mG/WPJ5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BGYOZg1oz+pK70siuzBVscloQtPLw2hoXfu43y0DkQedvl6KwTPOnAiOJfZk7+ZEJaglwOTzTvf0VtsQJBAvmWCM4jDu/uHu2f+Q3Zl6N/cI9DVWVaYLfUv7gCbqXzjOVdp1a5lrLGwn5c87+hGKVMjNQCgULE9LvvV0yL5vhV8RUSeTu0ry5h1akiK5EDtVXGqGuO1RyWZhdhJetZKVirmSZ+plqkecRRmRM/phrh6PzOdyNTtc+xTlkjukrAVkdTBqqMgwCw2sI1eDgURkmy2QhrNC8J9IkWshuS9Rs61Frc10O11KRXT1jFvSyVFEGt5LorkJYHqQXO4B5/gdHzeE0Hn9P9m1IJ1Rq1/zShsMDoljohD2QBc8GXgJgCmcLwC+k5MU/AzHwboFBiDfhVj22ipGqsNY3gqjFFL1dTVHLij5DxRLYfhKKJOFc8SfGMfdHcCStzKwdSEcwutNrDymCAMS7qqHmdtAOoVbjlNfSJny6yzhWokRHwpHKKnbR8/9UzAfiWTxGJBZCNTymjxww8n2Xq3NZq7rPGaxNkBL8ib3VHxe4Mf1XWp6oWMLoJEY0oPymrhOCksJR020h0+dd0kx1gQtTH8mOZLJBcmuKVIWuOONa1qzUQvibIpwherpF7qxe1L76Zyv2mzgK7RM/rIrKghv4kcqtciTW0Kn88jchI92XuZRsADchTHiFSZyKYVpeFzyvLsamndMj6DzUCEeoP2Y2Fvo4HIqh7i/b9rNP2GMCY09NKqaR7an9AHcuG/2weMHkAIHafu61NOV/eDr7o/Xt2j2oXbtlGvPyw/gwM9wAJ75T2xIwy/rh7vs5y85j7k1UOnHtaSghMY0vXDt6fwl/CvR9Qx42l8dnX11PoO58uQjvV/Z3i0/zv1TMcznVZZNF8F3TKs1vp8t5AXVf8hbiG5u9g1D6gxfogHqGb5jjgbXr5qh2d/AA==</diagram></mxfile>
11 changes: 5 additions & 6 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

# Protocol

1. [MPC-TLS](./protocol/mpc-tls/README.md)
- [TLS Handshake](./protocol/mpc-tls/handshake.md)
- [MPC-TLS](./protocol/mpc-tls/README.md)
- [Handshake](./protocol/mpc-tls/handshake.md)
- [Encryption and Decryption](./protocol/mpc-tls/encryption.md)
- [Commitment](./protocol/mpc-tls/commitment.md)
- [Signing](./protocol/mpc-tls/signing.md)
2. [Verification](./protocol/verification.md)
3. [Selective Disclosure]()
- [Notarization](./protocol/notarization.md)
- [Verification]()
- [Selective Disclosure]()

# MPC

Expand Down
4 changes: 4 additions & 0 deletions src/css/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:root {
--content-max-width: 1000px;
}

.aligncenter {
text-align: center;
}
61 changes: 42 additions & 19 deletions src/mpc/key_exchange.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,63 @@
# Key Exchange

In TLS, the first step towards obtaining TLS session keys is to compute a shared secret between the client and the server by running the [ECDH protocol](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie–Hellman). The resulting shared secret in TLS terms is called the pre-master secret `PMS`.
In TLS, the first step towards obtaining TLS session keys is to compute a shared secret between the client and the server by running the [ECDH protocol](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie–Hellman). The resulting shared secret in TLS terms is called the pre-master secret.
heeckhau marked this conversation as resolved.
Show resolved Hide resolved

<img src="../../png-diagrams/key_exchange.png" width="800">
<div class="aligncenter"><img src="../../png-diagrams/key_exchange.png" width="800"></div>

Using the notation from Wikipedia, below is the 3-party ECDH protocol between the `Server` the `Requester` and the `Notary`, enabling the `Requester` and the `Notary` to arrive at shares of `PMS`.
## ECDH

We will denote:

1. `Server` sends its public key $Q_b$ to `Requester`, and `Requester` forwards it to `Notary`
2. `Requester` picks a random private key share $d_c$ and computes a public key share $Q_c = d_c * G$
3. `Notary` picks a random private key share $d_n$ and computes a public key share $Q_n = d_n * G$
4. `Notary` sends $Q_n$ to `Requester` who computes $Q_a = Q_c + Q_n $ and sends $Q_a$ to `Server`
5. `Requester` computes an EC point $(x_p, y_p) = d_c * Q_b$
6. `Notary` computes an EC point $(x_q, y_q) = d_n * Q_b$
7. Addition of points $(x_p, y_p)$ and $(x_q, y_q)$ results in the coordinate $x_r$, which is `PMS`. (The coordinate $y_r$ is not used in TLS)
- $P$ as the `Prover`
- $V$ as the `Verifier`
- $S$ as the `Server`
- $\mathbb{pms}$ as the TLS pre-master secret.

Below is the 3-party ECDH protocol between $S$, $P$ and $V$, enabling $P$ and $V$ to arrive at shares of $\mathbb{pms}$.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Below is the 3-party ECDH protocol between $S$, $P$ and $V$, enabling $P$ and $V$ to arrive at shares of $\mathbb{pms}$.
$S$, $P$ and $V$ perform the 3-party ECDH protocol together. The result is that both $P$ and $V$, each have a share of the $\mathbb{pms}$. The 3-party ECDH protocol consists of following steps:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we should avoid 3-party here. I'd say the server plays its normal role. The TLS-client is a 2PC between the Prover and the Verifier.
Note that the diagram also uses 2PC

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mention that the notation is from Wikipedia, so ppl could have wikipedia open and easier follow the explanation.



1. $S$ sends its public key $Q_b$ to $P$, and $P$ forwards it to $V$
2. $P$ picks a random private key share $d_c$ and computes a public key share $Q_c = d_c * G$
heeckhau marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the diagram to also have the word "share" there?

3. $V$ picks a random private key share $d_n$ and computes a public key share $Q_n = d_n * G$
4. $V$ sends $Q_n$ to $P$ who computes $Q_a = Q_c + Q_n $ and sends $Q_a$ to $S$
5. $P$ computes an EC point $(x_p, y_p) = d_c * Q_b$
6. $V$ computes an EC point $(x_q, y_q) = d_n * Q_b$

Now our goal is to compute additive shares of $\mathbb{pms}$, which we'll redenote as $x_r$, using elliptic curve point addition
heeckhau marked this conversation as resolved.
Show resolved Hide resolved

Using the notation from [here](https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication#Point_addition), our goal is to compute
$$ x_r = (\frac{y_q-y_p}{x_q-x_p})^2 - x_p - x_q $$

in such a way that
1. Neither party learns the other party's $x$ value
2. Neither party learns $x_r$, only their respective shares of $x_r$.

We will use two maliciously secure protocols described on p.25 in the paper [Efficient Secure Two-Party Exponentiation](https://www.cs.umd.edu/~fenghao/paper/modexp.pdf):
- Neither party learns the other party's share.
- Neither party learns $x_r$, only their respective shares of $x_r$.

To do this we will need two functionalities defined below:

### A2M

- `A2M` protocol, which converts additive shares into multiplicative shares, i.e. given shares `a` and `b` such that `a + b = c`, it converts them into shares `d` and `e` such that `d * e = c`
- `M2A` protocol, which converts multiplicative shares into additive shares
$\mathsf{A2M}$ converts additive shares into multiplicative shares.

We apply `A2M` to $y_q + (-y_p)$ to get $A_q * A_p$ and also we apply `A2M` to $x_q + (-x_p)$ to get $B_q * B_p$. Then the above can be rewritten as:
For example, given additive shares $a$ and $b$ such that $a + b = c$, invoking $\mathsf{A2M}$ gives $(d, e) \larr (a, b)_{\mathsf{A2M}}$ such that $d * e = c$

### M2A

$\mathsf{M2A}$, which converts multiplicative shares into additive shares.

For example, given multiplicative shares $d$ and $e$ such that $d * e = c$, invoking $\mathsf{M2A}$ gives $(a, b) \larr (d, e)_{\mathsf{M2A}}$ such that $a + b = c$

### Deriving additive shares of the pre-master secret

We apply $\mathsf{A2M}$ to $y_q + (-y_p)$ to get $A_q * A_p$ and also we apply $\mathsf{A2M}$ to $x_q + (-x_p)$ to get $B_q * B_p$. Then the above can be rewritten as:

$$x_r = (\frac{A_q}{B_q})^2 * (\frac{A_p}{B_p})^2 - x_p - x_q $$

Then the first party locally computes the first factor and gets $C_q$, the second party locally computes the second factor and gets $C_p$. Then we can again rewrite as:

$$x_r = C_q * C_p - x_p - x_q $$

Now we apply `M2A` to $C_q * C_p$ to get $D_q + D_p$, which leads us to two final terms each of which is the share of $x_r$ of the respective party:
Now we apply $\mathsf{M2A}$ to $C_q * C_p$ to get $D_q + D_p$, which leads us to two final terms each of which is the share of $x_r$ of the respective party:

$$x_r = (D_q - x_q) + (D_p - x_p)$$

$$x_r = (D_q - x_q) + (D_p - x_p)$$
Now each party holds their respective additive shares of the TLS pre-master secret.
Binary file modified src/png-diagrams/key_exchange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/png-diagrams/mpc-decryption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/png-diagrams/mpc-encryption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/protocol/mpc-tls/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# MPC-TLS

During the MPC-TLS Phase the `Prover` and the `Notary` work together to generate an authenticated `Transcript` of a TLS session with a `Server`.
During the MPC-TLS Phase the `Prover` and the `Verifier` work together to generate an authenticated `Transcript` of a TLS session with a `Server`.

Listed below are some key points regarding this process:

- The identity of the `Server` is not revealed to the `Notary`, but the `Prover` is capable of proving the `Server` identity to a `Verifier` later.
- The `Notary` only ever sees the *encrypted* application data of the TLS session.
- The identity of the `Server` can be hidden from the `Verifier`, while the `Prover` is still capable of proving the `Server` identity later.
- The `Verifier` only ever sees the *encrypted* application data of the TLS session.
- The protocol guarantees that the `Prover` is not solely capable of constructing requests, nor can they forge responses from the `Server`.
7 changes: 0 additions & 7 deletions src/protocol/mpc-tls/commitment.md

This file was deleted.

22 changes: 9 additions & 13 deletions src/protocol/mpc-tls/encryption.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
# Encryption, Decryption, and MAC Computation

This section explains how the `User` and `Notary` use MPC to encrypt data for the server, decrypt data received from the server, and compute the MAC for the ciphertext using MPC.
This section explains how the `Prover` and `Verifier` use MPC to encrypt data sent to the server, decrypt data received from the server, and compute the MAC for the ciphertext using MPC. It shows how the `Prover` and `Verifier` collaborate to encrypt and decrypt data. The `Verifier` performs these tasks "blindly", without acquiring knowledge of the plaintext.

## Encryption

To encrypt the plaintext, both parties input their TLS key shares as private inputs to the [MPC](/mpc/deap.md) protocol, along with some other public data. Additionally, the `User` inputs her plaintext as a private input.
To encrypt the plaintext, both parties input their TLS key shares as private inputs to the [MPC](/mpc/deap.md) protocol, along with some other public data. Additionally, the `Prover` inputs her plaintext as a private input.

Both parties see the resulting ciphertext and execute the [2PC MAC](../../mpc/mac.md) protocol to compute the MAC for the ciphertext.
![Encryption](../../png-diagrams/mpc-encryption.png)

The `User` then dispatches the ciphertext and the MAC to the server.
Both parties see the resulting ciphertext and execute the [2PC MAC](../../mpc/mac.md) protocol to compute the MAC for the ciphertext.

As explained in the [Commitment section](commitment.md), the `User` creates a commitment to the plaintext (her private input to MPC).
The `Prover` then dispatches the ciphertext and the MAC to the server.

## Decryption

Once the `User` receives the ciphertext and its associated MAC from the server, the parties first authenticate the ciphertext by validating the MAC. They do this by running the [MPC](/mpc/mac.md) protocol to compute the authentic MAC for the ciphertext. They then verify if the authentic MAC matches the MAC received from the server.
Once the `Prover` receives the ciphertext and its associated MAC from the server, the parties first authenticate the ciphertext by validating the MAC. They do this by running the [MPC](/mpc/mac.md) protocol to compute the authentic MAC for the ciphertext. They then verify if the authentic MAC matches the MAC received from the server.

Next, the parties decrypt the ciphertext by providing their key shares as private inputs to the [MPC](/mpc/deap.md) protocol, along with the ciphertext and some other public data.

The resulting plaintext is revealed ONLY to the `User`.

As discussed in the [Commitment section](/protocol/mpc-tls/commitment.md), the `User` creates a commitment to the plaintext.

Please note, the actual low-level implementation details of `Decryption` are more nuanced than what we have described here. For more information, please consult [Low-level Decryption details](/mpc/encryption.md).
![Decryption](../../png-diagrams/mpc-decryption.png)

## Summary
The resulting plaintext is revealed ONLY to the `Prover`.

This chapter illustrated how the `Notary` and `User` collaborate to encrypt and decrypt data. The `Notary` performs these tasks "blindly", without acquiring knowledge of the plaintext. In fact, the `Notary` even remains unaware of which `Server` the `User` is communicating with. Additionally, the `User` creates commitments to the plaintext and can use them later to prove the authenticity of the plaintext to a third party `Verifier`.
Please note, the actual low-level implementation details of decryption are more nuanced than what we have described here. For more information, please consult [Low-level Decryption details](/mpc/encryption.md).
Loading