Abstract
Multi-party computation (MPC) sorting and searching protocols are frequently used in different databases with varied applications, as in cooperative intrusion detection systems, private computation of set intersection and oblivious RAM. Ivan Damgard et al. have proposed two techniques i.e., bit-decomposition protocol and bit-wise less than protocol for MPC. These two protocols are used as building blocks and have proposed two oblivious MPC protocols. The proposed protocols are based on data-dependent algorithms such as insertion sort and binary search. The proposed multi-party sorting protocol takes the shares of the elements as input and outputs the shares of the elements in sorted order. The proposed protocol exhibits
Keywords
Introduction
Andrew Yao [30] in 1982, has proposed a two-party computation (2PC), considered as Holy Grail of cryptography. The goal of 2PC is to create protocols allowing two parties to cooperatively compute an arbitrary function of their private inputs without sharing the clear value of their inputs with the opposing party. Yao gives evidence of feasibility with a solution to the so-called Millionaires’ problem. The problem is stated as follows: two millionaires wish to learn who is the richer without telling their actual wealth to the other.
A natural generalization of the secure two-party computation is the secure multiparty computation (MPC). Secure multi-party computation can be defined as the problem of n participants to compute an agreed function of their inputs in a secure way, where security means guaranteeing the correctness of the output as well as the privacy of the users’ inputs. The mathematical model for secure multi-party computation is formally defined as the parties
Sorting and searching are the most important primitives used in computer science, specially in database operations, data mining and data analysis operations to preserve privacy. Multi-party computation sorting protocols are frequently used in different database operations and have many applications in cooperative intrusion detection systems [18], oblivious RAM [5], and private set intersection [16]. Multi-party sorting and searching protocols also have potential applications in IoT and Blockchain [7,17,29].
A sorting algorithm is said to be stable, if two objects with equal keys appear in the same order in sorted output as they appear in the input to be sorted. Some algorithms satisfy stable sorting by nature. Insertion sort is one of the stable sorting algorithm.
The multi-party computation protocols must be data oblivious. Most popular algorithms available are not data oblivious. An algorithm is said to be data oblivious, only when the algorithm’s control flow is independent of the input. Up to date there does not exist any efficient algorithm to transform data-dependent algorithms into data oblivious protocols. There are other various mechanisms involved to convert data-dependent algorithms into data oblivious protocols. As these mechanisms take an exponential amount of time to compute, they are not considered to be effective.
Any given function will be evaluated securely with the help of a circuit illustration of the given input function. The first circuit representation of a function is given in [10,11]. Using a circuit illustration of a given function, it is not an easy task to design effective multi-party protocols for a complex set of algorithms. Many proposals are made to construct effective multi-party protocols. Some building blocks of MPC protocols are the computation of bit-decomposition protocol, modulo reduction protocol and bit-wise less than protocol or comparison protocol.
Our contribution
In TCC 2006, Ivan Damgard et al. [4] have designed two naive techniques: bit-decomposition protocol and bit-wise less than protocol. Bit-decomposition protocol converts shares of a secret s into shares of the bits of s. Further, in PKC 2007, Takashi Nishide and Kazuo Ohta [22] have presented an improved and simplified version of the bit-decomposition protocol and comparison protocol. The proposed work has used these protocols [4,22] as building blocks for sorting and searching. It has also proposed oblivious multi-party sorting and binary search protocols from the data-dependent insertion sort and binary search algorithms. The proposed sorting protocol takes input as shares of the elements and outputs their shares in a sorted order. The proposed multi-party insertion sort protocol is best suited, when input is of almost sorting order. A complexity of
Related work
Any circuit-based sorting algorithms are considered to be sorting networks. Since sorting networks are designed in circuit style and circuit-based algorithms are data-oblivious, so they can be efficiently extended to MPC protocols. Some of the sorting algorithms used for MPC system, are given as network sorting algorithms. In [1], Ajtai has introduced an efficient network sorting algorithm called the AKS sorting algorithm. The worst case complexity is given as
Organization
The organization of rest of the paper is as follows: Section 2 provides basic background to be used later. Section 3 introduces the oblivious insertion sort protocol to sort out the given list of elements in a shared environment. Section 4 introduces the oblivious binary search protocol to search an element in a shared environment. Section 5 discloses the evaluation of the implemented results and comparison with existing protocols and Section 6, concludes the work.
Preliminaries
Some standard notations and some well-known techniques are used in this part. This work presumes that n parties in a synchronous network are connected by perfectly secure channels. This work focuses on the standard MPC scheme named a secret sharing scheme. The proposed work considers all input values and output values for the secret sharing scheme that belong to the field
Notations and assumptions
Multi-party Computation / Multiparty Computation. The secret value is named as s. The shares of a given secret s. Shares of the secret A in matrix form. The party i, i.e The share of secret a to the party Addition of shares of secret p and secret q. Shares of p multiplied by a constant public parameter c. Shares of either 1 or 0 depending on the condition. Shares of either 1 or 0 depending on the equal condition. A finite field with the elements
Building blocks
The proposed work introduces some already existing protocols, which are used as building blocks for the proposed protocols.
Shamir’s secret sharing scheme
Liu [20] has found an issue which is given below. “Eleven scientists are working on a secret project. They wish to lock up documents in a cabinet so that the cabinet can be opened if and only if six or more of the scientists are present. What is the smallest number of locks needed? What is the smallest number of keys to the locks each scientist must carry?”
“The answer for these problems are 462 locks and 252 keys per scientist. This is not a practical solution for this kind of problem”. The notes is adapted from [6,15,26] to describe the secret-sharing concept.
Shamir’s scheme of secret communication provides a generalized solution to the above problem. It takes the secret as data D and breaks it into number of pieces. To rebuild the data, it takes at least t- pieces. But information about D is not revealed from
Let
The objective of this protocol is to generate u – number of shares of secret s. It can be computed using at least Third-party D picks a polynomial The third-party D distributes to each player j the share
From the t – number of shares one can build the polynomial
Lagrange polynomial. Let
The oracle invocation of this sub protocol can be represented as
Perfect Security: With
With
Ideal: The size of the share of the secret is the same as the size of the secret. Extendable: The addition of shares is calculated by computing extra points in the polynomial. Homomorphic Property: The addition or multiplication of shares of a secret with a constant provides a new secret. Consider two secret values m and n. Their shares are
Ben-Or et al. [11] have proposed a multiplication protocol. Suppose there are two secrets
Using Shamir’s secret sharing, for secret
Similarly, for secret
Dealer D, computes
Therefore
If we observe clearly, we get polynomial f(x) as
In this protocol t (not Now each party Party Let us define the new polynomial
In the implementation of the MULT protocol it uses a constant number of rounds and
Let prime value be
Now
Similarly, the second party computes the shares of the random polynomial
The following table indicates the shares according to their random polynomials.
Let us consider the polynomial
Presently, the proposed shares are
This is a simple example demonstrating the multiplication of two secrets.
Bit-decomposition protocol (BITS) [4,22]
In [4], a naive MPC protocol is proposed and later it is simplified in [22]. Bit-decomposition protocol converts a polynomial sharing of secret s into the shares of the bits of s. This technique is proposed with a constant number of rounds.
The bit-decomposition protocol will take the input as shares of the elements in a finite field and produce the output as shares of the bits of the given element.
The main aim of this protocol is to fill the gap between the arithmetic and Boolean circuits of a function. Arithmetic circuits take the input in integer form, whereas Boolean circuits take input in bit form. Bit-decomposition protocol is an important and powerful tool to represent shared secrets of Boolean circuits as well as arithmetic circuits. This protocol takes the complexity of
In the above protocol, Solved_Bits() is a sub-protocol that generate a random number of shares, OPEN is a reconstruction protocol to reveal the secret. In the above protocol, Bit_Addition is a sub-protocol which takes two inputs as bits of the shares of two different secrets. The output is bit shares of addition of secrets. The present work has implemented the bit-decomposition protocol given by Ivan Damgard et al. [4] on
Bit-wise less than protocol (BIT-LT) [4,22]
This protocol takes two inputs and produces one output. One of the inputs for the sub-protocol are shares of bits of m represented as
The output is shares of the bit 1 or 0 depending on the condition (
The proposed work has implemented the bit-wise less than protocol on
In the above protocol XOR, is the exclusive-OR operation between the shares parties.
Adversarial behavior in MPC [24,25]
Semi-honest adversaries: These adversaries are not deviating the protocol, they are just following the protocol. The adversary can study the internal information of the corrupted parties. These are also called passive adversarial models. In this, dishonest parties are also exactly following the specification of the protocol. While executing transcript messages in the protocol, there is a chance of leaking additional information when attempts are made to learn. It is a weak adversary model. These are also named as “honest-but-curious.” Malicious adversaries: The adversary can take complete control over the parties and can make them misbehave in any desired manner. In the malicious model, restrictions are not placed on any of the participants. Thus parties are completely free to spoil the actions that are placed in the protocol. These are active adversaries. These adversaries may deviate from the protocol execution.
Oblivious security model
This security model is considered against a semi-honest adversary with
Formally, security in the semi-honest adversary model is defined as follows. Let A probabilistic polynomial n-ary function Which can simulate the ([8]).
Oblivious insertion sort protocol
There is a problem with most general sorting algorithms, as they are data-dependent. It is difficult to convert data-dependent algorithms into a MPC environment.

Oblivious insertion sort protocol
The work has proposed an oblivious sorting protocol to convert the data-dependent insertion sort algorithm into an oblivious sorting protocol. The proposed work has used the existing protocols such as bit-decomposition and bit-wise less than protocols as building blocks. The proposed oblivious insertion sort protocol is shown as Protocol 1. The input for this protocol are shares of the elements. It returns the shares of sorted values as output. The shares of the input are generated by using Shamir’s secret sharing scheme. The proposed oblivious insertion sort protocol starts from line 6. The bit-decomposition protocol is first applied to the shares of the key and converted into bit shares. The same procedure is repeated in line 7 for the shares of
The proposed protocol 1 is oblivious and preserves privacy in the semi-honest adversary model.
A protocol should not reveal anything about data in presence of the semi-honest adversary model with
The simulator simulates the views of the protocols. Let
The simulator Υ is constructed as follows. Inputs and outputs are the same as those of the adversaries. Simulator Υ select inputs uniformly at random. For the input values
Round complexity: The round complexity of a protocol defines the number of rounds of parallel invocations of the communication. In the proposed work we have used the Laura et al. shuffling protocol [19]. The round complexity of shuffling protocol [19] is
Communication complexity: The communication complexity of a protocol defines the amount of data transmitted by the parties. The proposed protocol takes
For practical implementation, it is assumed that the number of parties m, the field bit-length l is constant, then the proposed protocol exhibits
The binary search algorithm is based on divide-and-conquer design technique. In this design technique the problem is divided into small problems. Recursively, solve small problems and combine these solutions, to obtain a solution to the original (larger) problem. To find a key k, in a large database file containing keys
The general binary search is a data dependent algorithm. An oblivious searching protocol is proposed to convert a data-dependent binary search algorithm into an oblivious binary search protocol. A recursive version of the oblivious binary search protocol is proposed. The existing protocols such as bit-decomposition protocol, reconstruct protocol and bit-wise less than protocol are used as building blocks to design the oblivious binary search protocol. The proposed oblivious binary search protocol is shown as Protocol 2. In the proposed protocol, the initialization in line number 1 i.e.,

Oblivious binary search protocol
The input for the proposed oblivious binary search protocol consists in shares of the already sorted elements and the shares of the element to be searched. In line 3, mid value is calculated. The actual oblivious searching protocol starts from line 6. In line 6 of the proposed protocol, the shares of the array of the mid element are converted to bit shares. In line 7, the shares of the element to be searched are converted into bit shares of the element. Line 8 is the comparison of the bit shares of line 6 and line 7. Line 8, will generate the shares of either 1 or 0 depending on the condition. Line 9 reveals the value of c. However, when the value of c is revealed, there is no information leakage. It is the only share value. Hence leakage of information is prevented. Depending on c, if it is equal to 1 then there is a recursive call from
The proposed protocol 2 is oblivious and secure in the semi-honest adversary model.
The security of the proposed protocol relies on the security of the MPC primitives such as, bit-decomposition protocol and bit-wise less than protocol. These two sub-protocols are already proved to be secure and so the proposed protocol is also secure. The only possibility of information leakage would be the reconstruction step which reveals the value of c. However, the revealed c is a share of the value and not the original value. Therefore, the proposed protocol leaks no additional information. □
The proposed work has been compared with the complexity of the existing quick sort protocol. The comparison result is given in Table 1. From a communication point of view, the same results are achieved. On average case the proposed work is better than existing protocol [14]. Experimental results shows that the proposed oblivious sorting protocol works better than the [14], when the input is given in almost sorted order.
Comparison of the complexities of already available sorting protocols, where n is the number of input values
Comparison of the complexities of already available sorting protocols, where n is the number of input values
The practical efficiency of the proposed sorting protocol is demonstrated in this work. Also, for the comparison of the experimental results, the proposed oblivious insertion sort and traditional quick sort protocols are implemented. The implementation is carried out with (2, 3) Shamir’s secret sharing scheme. Also the bit-decomposition protocol, bit-wise less than protocol [4,22], multiplication protocol, share_construct and reconstruct protocols are implemented as building blocks for the proposed schemes. Here all the values are elements of

Comparison of oblivious insertion sort protocol with existing quick sort [14], when the elements are given in almost sorted order. The sub-figure is a clear view of a comparison of up to 512 elements.

Comparison of the oblivious insertion sort protocol with the existing quick sort protocol, when the elements are given in random order. The sub-figure is a clear view of a comparison of up to 512 elements.
All the experiments are implemented on machines configured with an Intel(R) i7-6700 3.41 GHz processor, 16 GB RAM and 64-bit Operating system. The implementation is held in a visual studio code C

Performance comparison of the proposed binary search protocol with the general binary search algorithm.
Figure 3 exhibits the comparison of the proposed oblivious binary search protocol with the general binary search algorithm. It shows that the proposed binary search protocol gives good results along with the general binary search algorithm in the above setting. The number of items already sorted to search the element are taken along the x-axis and total execution time in seconds along the y-axis. The proposed oblivious insertion sort protocol is the suitable choice, when the number of elements is limited and the elements are almost in a sorted order. The proposed binary search protocol gives good result, when compared with the general binary search algorithm in a secret-sharing concept.
The present work has proposed simple and secure oblivious protocols based on the sorting principles, searching principles, and MPC primitives as building blocks. It is proved that the oblivious insertion sort protocol works better than quick sort protocol, when input elements are almost in sorted order. The proposed oblivious binary search protocol gives almost the same results compared to the general binary search algorithm. The feasibility of the proposed protocols has been demonstrated by an implementation of the MPC scheme based on
