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

Plan to add TLSIO? #64

Open
weikengchen opened this issue Jun 18, 2019 · 3 comments
Open

Plan to add TLSIO? #64

weikengchen opened this issue Jun 18, 2019 · 3 comments

Comments

@weikengchen
Copy link
Contributor

weikengchen commented Jun 18, 2019

The current network I/O component, NetIO, does not have end-to-end encryption of the circuits. There are two small problems:

  1. An in-path attacker (not a party in the MPC) could tamper the circuits in some ways, such that, the final result does not pass the check, and the computation becomes futile. If there is TLS, the parties could detect that earlier and may not waste so much computation resource.
  2. If in the future there are going to be honest-majority MPC tools in emp-toolkit, the honest-majority MPC platforms may need TLS connections among each other to prevent a network attacker from inferring additional information.

One who wants to implement TLS connections may add Secure Socket API (SSAPI, USENIX Security'18) or just add an OpenVPN between the parties. Yet, these implementations are kind of untidy and might not be the optimal option.

So, is there a plan to add TLSIO?

In addition, there might be an interesting research problem here. Nowadays, the fastest TLS cipher suite, I believe, is AES-GCM AEAD leveraging AES-NI. So, a pure implementation AG-MPC + TLSIO could end up to be 2x the calls to AES compared to no-TLS implementations. It would be interesting to see if one can avoid so many additional AES calls by designing an MPC protocol where adding network encryption & authentication is cheap, without the need for standard TLS.

@wangxiao1254
Copy link
Member

wangxiao1254 commented Jun 18, 2019

I myself am not planning for it since we do not need it for now. But pull request is welcome :)

@weikengchen
Copy link
Contributor Author

weikengchen commented Jun 21, 2019

I may contribute some code for this since it is needed for a project. My proposal for implementation is as follows. Let me know if there are any red flags.

IO channel

I think adding a separate IO channel for TLS (e.g., TLSIO) will be complicated, since a large part of emp-toolkit has been hard-coded with the string NetIO, e.g., NetIOMP, delta_ot.

So, a better solution might be to add a compiling option in emp-tool for enabling TLS connections in the NetIO channel. When this option is turned on, a TCP connection will become a TLS connection. Details of implementation are transparent to upstream tools. The TLS feature will be reserved for advanced players and be off by default.

Certificate

The standard method for establishing TLS connections is for servers to store each other's certificate. Other methods, like making PSK among each pair of parties, might not scale for AG-MPC. So it is a no-brainer to do certificates.

The NetIO will now check whether in the current directory, a subdirectory named certificates exists. If it exists, it loads the current party's certificates and private key and the CA certificate from that directory. Otherwise, it outputs a fatal error saying certificate not found. This check is only enabled when the compiling option asks to use TLS.

The IO channel checks the certificate based on whether the certificate's common name matches the IP address since NetIO does not have access to upstream information; that is, NetIO does not know the ID of the party connecting to.

Cipher

The TLS connection is likely implemented by TLS1.3 AES-GCM-128, AEAD. This should be so far the fastest method given AES-NI.

@wangxiao1254
Copy link
Member

wangxiao1254 commented Jun 25, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants