Skip to main content

Encryption

Here we will explain our protocol for 2PC encryption using a block cipher in counter-mode.

Our documentation on Dual Execution with Asymmetric Privacy is recommended prior reading for this section.

Preliminary

Ephemeral Keyshare

It is important to recognise that the Notary's keyshare is an ephemeral secret. It is only private for the duration of the User's TLS session, after which the User is free to learn it without affecting the security of the protocol.

It is this fact which allows us to achieve malicious security for relatively low cost. More details on this here.

Premature Leakage

A small amount of undetected premature keyshare leakage is quite tolerable. For example, if the Notary leaks 3 bits of their keyshare, it gives the User no meaningful advantage in any attack, as she could have simply guessed the bits correctly with 23=12.5%2^{-3} = 12.5\% probability and mounted the same attack. Assuming a sufficiently long cipher key is used, eg. 128 bits, this is not a concern.

The equality check at the end of our protocol ensures that premature leakage is detected with a probability of 12k1 - 2^{-k} where k is the number of leaked bits. The Notary is virtually guaranteed to detect significant leakage and can abort prior to notarization.

Plaintext Leakage

Our protocol assures no leakage of the plaintext to the Notary during both encryption and decryption. The Notary reveals their keyshare at the end of the protocol, which allows the Notary to open their garbled circuits and oblivious transfers completely to the User. The User can then perform a series of consistency checks to ensure that the Notary behaved honestly. Because these consistency checks do not depend on any inputs of the User, aborting does not reveal any sensitive information (in contrast to standard DualEx which does).

Integrity

During the entirety of the TLS session the User performs the role of the garbled circuit generator, thus ensuring that a malicious Notary can not corrupt or otherwise compromise the integrity of messages sent to/from the Server.

Notation

  • pp is one block of plaintext
  • cc is the corresponding block of ciphertext, ie c=Enc(k,ctr)pc = \mathsf{Enc}(k, ctr) \oplus p
  • kk is the cipher key
  • ctrctr is the counter block
  • kUk_U and kNk_N denote the User and Notary cipher keyshares, respectively, where k=kUkNk = k_U \oplus k_N
  • zz is a mask randomly selected by the User
  • ectrectr is the encrypted counter-block, ie ectr=Enc(k,ctr)ectr = \mathsf{Enc}(k, ctr)
  • Enc\mathsf{Enc} denotes the block cipher used by the TLS session
  • comx\mathsf{com}_x denotes a binding commitment to the value xx
  • [x]A[x]_A denotes a garbled encoding of xx chosen by party AA

Encryption Protocol

The encryption protocol uses DEAP without any special variations. The User and Notary directly compute the ciphertext for each block of a message the User wishes to send to the Server:

f(kU,kN,ctr,p)=Enc(kUkN,ctr)p=cf(k_U, k_N, ctr, p) = \mathsf{Enc}(k_U \oplus k_N, ctr) \oplus p = c

The User creates a commitment to the plaintext active labels for the Notary's circuit Com([p]N,r)=com[p]N\mathsf{Com}([p]_N, r) = \mathsf{com}_{[p]_N} where rr is a random key known only to the User. The User sends this commitment to the Notary to be used in the authdecode protocol later. It's critical that the User commits to [p]N[p]_N prior to the Notary revealing Δ\Delta in the final phase of DEAP. This ensures that if com[p]N\mathsf{com}_{[p]_N} is a commitment to valid labels, then it must be a valid commitment to the plaintext pp. This is because learning the complementary wire label for any bit of pp prior to learning Δ\Delta is virtually impossible.

Decryption Protocol

The protocol for decryption is very similar but has some key differences to encryption.

For decryption, DEAP is used for every block of the ciphertext to compute the masked encrypted counter-block:

f(kU,kN,ctr,z)=Enc(kUkN,ctr)z=ectrzf(k_U, k_N, ctr, z) = \mathsf{Enc}(k_U \oplus k_N, ctr) \oplus z = ectr_z

This mask zz, chosen by the User, hides ectrectr from the Notary and thus the plaintext too. Conversely, the User can simply remove this mask in order to compute the plaintext p=cectrzzp = c \oplus ectr_z \oplus z.

Following this, the User can retrieve the wire labels [p]N[p]_N from the Notary using OT.

Similarly to the procedure for encryption, the User creates a commitment Com([p]N,r)=com[p]N\mathsf{Com}([p]_N, r) = \mathsf{com}_{[p]_N} where rr is a random key known only to the User. The User sends this commitment to the Notary to be used in the authdecode protocol later.

Proving the validity of [p]N[p]_N

In addition to computing the masked encrypted counter-block, the User must also prove that the labels [p]N[p]_N they chose afterwards actually correspond to the ciphertext cc sent by the Server.

This is can be done efficiently in one execution using the zero-knowledge protocol described in [JKO13] the same as we do in the final phase of DEAP.

The Notary garbles a circuit GNG_N which computes:

pectr=cp \oplus ectr = c

Notice that the User and Notary will already have computed ectrectr when they computed ectrzectr_z earlier. Conveniently, the Notary can re-use the garbled labels [ectr]N[ectr]_N as input labels for this circuit. For more details on the reuse of garbled labels see [AMR17].