**1. Introduction **

Processing private data on the cloud is an inevitable fact nowadays, as the mobile market grows rapidly while moving computations to the cloud. Yet, preserving user privacy for cloud computing remains a big concern for both users and researchers. In the ideal case, the user should put an encrypted version of her data on the cloud, while the cloud is still able to accomplish the required processing task successfully on the encrypted data.

Extensive work has been done in the area of privacy preserving signal processing, including two main research lines: homomorphic encryption and secure multiparty computation (MPC). In this post, we will discuss both techniques with examples and compare them.

Among many applications for privacy preserving signal processing, we will focus on a TV detection system using mobile phones. In this system, we leverage mobile phones, which are now always in hands, to record audio while users being indoors. We use the recorded audio samples to detect if the user is watching over-the-air (OTA) TV channels or not. Our system accomplish this task by correlating the uploaded data from users with live captured streams from OTA channels received through ATSC antenna and TV tuner.

We assume in the whole post, that the adversary model to be studied is the semi-honest adversary model in which the adversary follows all the steps in the protocol, but will try to know any leaked information about the other party’s values.

**2. Homomorphic Encryption **

In this section, we will present the details of the homomorphic encryption while focusing on additively homomorphic and multiplicative homomorphic cryptosystems.

** 2.1. Problem Definition **

Given a feature vector recorded and uploaded by a user named Alice to the processing server Bob, the server is responsible for estimating a certain function . To preserve the privacy of Alice, she sends the encrypted version using her primary key and Bob estimates which satisfies the following property .

** 2.2. Additively Homomorphic Encryption **

Theorem 1. Given plaintext and , a public-key cryptosystem is additively homomorphic if

A direct result from previous theorem, , as , which equals .

To illustrate the additively homomorphic property, we give the following example: let Alice has and and sends , to Bob, who is responsible for computing :

If Alice used public-key cryptosystem that has the additively homomorphic property, then Bob can leverage Theorem~1 and compute the following

An example of additively homomorphic cryptosystem is Paillier cryptosystem.

**Paillier cryptosystem:** Choose two large prime numbers and , set and select randomly . Let (known as Carmichael‘s function). Let function denotes the function . Then, is considered as public key and or equivalently is the private key.

- Encryption: given plaintext , select a random number , and compute ciphertext .
- Decryption: given ciphertext , compute plaintext .

In order to follow the decryption step, we need to mention Carmichael‘s theorem and a theorem from the Composite Residuosity framework proposed by Paillier. We refer the reader to the original paper by Paillier for the proof of Composite Residuosity Theorem.

Theorem 3For any , there exists a unique pair in the set such that , then

*Proof:* Now, we can prove the decryption step in the Paillier cryptosystem:

- , (using Carmichael‘s theorem) .
- Leverage Theorem~3 and the relationship that , then .

From last two steps, we can say that

After introducing the Paillier cryptosystem, we can now prove its additively homomorphic property:

*Proof:* Given plaintexts and :

**Important remark:** It is clear that random in doesn’t have to be equal to . Even though the proof is correct, as in the decryption step we don’t need r. We can see in step of the decryption proof, that we substitute the term by using the Carmichael‘s theorem. The value is only used to deceive the eavesdropper, so even if Alice generates the same plaintext, the corresponding ciphertext is different.

As, we can see additively homomorphic encryption works only for functions include adding encrypted data or multiplying encrypted data by plaintext. However, if we need to compute the multiplication of two messages while we have access only to their encrypted values, then we need other schemes like multiplicatively homomorphic encryption or secure multiparty computation.

** 2.3. Multiplicatively Homomorphic Encryption **

Theorem 4Given plaintext and , a public-key cryptosystem is multiplicatively homomorphic if

The RSA cryptosystem and ElGammal cryptosystem have multiplicatively homomorphic property.

**RSA cryptosystem:** Choose two large prime numbers and , set and set . Choose such that . Find such that

- Encryption: given plaintext , compute ciphertext .
- Decryption: given ciphertext , compute plaintext .

Now, we can prove that RSA cryptosystem has multiplicatively homomorphic property:

*Proof:* Given plaintexts and :

**3. Secure Multiparty Computation **

In this section, we will cover another research line targeting the privacy preserving signal processing problem. Secure Multiparty Computation requires the involvement of more than one party in the computation compared to the homomorphic encryption where only one entity is responsible for the computation.

** 3.1. Arithmetic Two Party Computation **

In this scheme, Alice and Bob wants to do arithmetic operation over encrypted data from one party and plaintext from the other party. For example, given from Alice and Bob wants to compare to . This operation is performed frequently in signal processing where the detection server filters (e.g. linear weighting as described before) the readings coming from certain sensor and compares the filtered signal with some threshold. Based on the comparison, the detection server declares whether the event has been happened or not.

In this scheme, Bob wants to detect if , then , and otherwise . The scheme works as follows: let , then Bob can compute :

is -bit positive number. If , then (most significant bit of ) equals to zero while it equals to otherwise. Bob can compute , if he knows the encrypted value of :

If , then , then . On the other hand, , then , then . Bob needs to know from Alice along with , to estimate which equals leveraging the additively homomorphic property.

** 3.2. Yao’s Garbled Circuits **

In this protocol, the goal is to compute the output of a function while the inputs are kept private. Yao’s garbled circuits protocol converts any function into a function that can be evaluated securely using logic circuit. Each input and output of each gate in the circuit is being encrypted to prevent the party executing the function from knowing any information about the inputs and outputs of each gate. Let’s explain the protocol using simple example.

Let Alice has 1 bit variable x and Bob has 1 bit variable y, and they want to find value .

- Alice generates the truth table of the circuit, in this example it is only one gate. We have two inputs and one output.

x y f 0 0 0 0 1 1 1 0 1 1 1 1 - Alice then generates 2 keys for each input or output, for , for and for . In this protocol, symmetric keys are being used which make it much easier to encrypt and decrypt in terms of complexity compared to public-key encryption.
- Alice encrypts the output of the gate using the two keys corresponding to the inputs values. So,

x y f 0 0 0 1 1 0 1 1 - Alice randomizes the entries of the encrypted truth table, so Bob will not be able to find relation between entry index and the input-output values.
- Alice then sends Bob her corresponding to the value of x and the garbled circuit.
- Bob needs also the key corresponding to the value of y, however, he cannot reveal the value of y to Alice. On the other hand, Alice cannot just send him the two keys corresponding to y, as in this case Bob can estimate the value of Alice’s x.
- Bob and Alice execute a protocol called Oblivious Transfer (OT), so Bob gets the required key without revealing the value of y.
- Bob then uses both keys and , to decrypt, the only entry he can, that corresponds to .

**Oblivious Transfer Protocol:**

As mentioned before, Alice has two strings, let say, and , and Bob picks and wants to get from Alice without telling Alice the value of nor knowing the other value . The OT protocol works as follows:

- Bob generates pair of public-private keys , and another key . Bob doesn’t know the corresponding private key of and it shouldn’t be distinguishable from .
- Bob sends to Alice two public keys and , picking , while .
- Alice computes ciphertext and and sends them to Bob
- Bob computes

**4. Conclusion **

In this post we covered two main cryptography solutions for preserving privacy for cloud based signal processing. Homomorphic encryption which gives the advantage for the server to compute the required function on users’ encrypted data without the need to include the users in the computation procedure. However, it requires public-key cryptosystem which has certain homomorphic properties. Public-key cryptosystems themselves require in general heavy computations in encryption and decryption, as we saw, for example exponentiation of large numbers. On the other hand, secure multiparty computation, facilitates the computation of any function using encrypted inputs while using symmetric keys which require less computations and memory than public-key encryption. Nevertheless, transferring complex functions will lead to large logic circuits which will require huge data to be communicated, specially for the oblivious transfer protocol.

For the TV Detection application, we believe the Paillier cryptosystem with its additively homomorphic property is suitable for our application. Of course, the enycrption and decryption for Paillier cryptosystem are computationally demanding tasks, however, multiple solutions can be employed to resolve this issue. First, precomputing part of the protocol that is not depending on the user input, can decrease the running time of the protocol. For example, large primes generation, random number generation and exponentiation of the generated random number can be executed in offline phase. Second, packing the data needed to be encrypted before sending it to the server could also improve the running time significantly. There will be a trade off, that has to be studied, between the compression ratio and the accuracy of the detection system. Finally, computing the encryption and decryption of users’ data using their local desktops or laptops could be a suitable solution instead of using their limited resources mobile phones.