Next Article in Journal
Comparison of the Selected Methods Used for Solving the Ordinary Differential Equations and Their Systems
Next Article in Special Issue
Efficient Generation of Roots of Power Residues Modulo Powers of Two
Previous Article in Journal
Monopolistic Dynamics with Endogenous Product Differentiation
Previous Article in Special Issue
An Efficient Approach to Point-Counting on Elliptic Curves from a Prominent Family over the Prime Field Fp
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Lightweight Secure Integer Comparison

1
TNO, Unit ICT, 2509 JE The Hague, The Netherlands
2
Centrum Wiskunde & Informatica, Cryptology Department, 1098 XG Amsterdam, The Netherlands
Mathematics 2022, 10(3), 305; https://doi.org/10.3390/math10030305
Submission received: 10 December 2021 / Revised: 12 January 2022 / Accepted: 13 January 2022 / Published: 19 January 2022

Abstract

:
We solve the millionaires problem in the semi-trusted model with homomorphic encryption without using intermediate decryptions. This leads to the computationally least expensive solution with homomorphic encryption so far, with a low bandwidth and very low storage complexity. The number of modular multiplications needed is less than the number of modular multiplications needed for one Pallier encryption. The output of the protocol can be either publicly known, encrypted, or secret-shared. The private input of the first player is computationally secure towards the second player, and the private input of the second player is even unconditionally secure towards the first player. We also introduce an efficient client-server solution for the millionaires problem with similar security properties.

1. Introduction

In the current era of big data, artificial intelligence, and privacy awareness, there is a growing need for securely computing with distributed data. The field of secure multi-party computation is evolving towards maturity, and leads to secure cryptographic solutions for this purpose. In its most general setting, there are multiple parties, each having private inputs, and they want to jointly evaluate a certain function on their inputs, without revealing those inputs. Although these cryptographic solutions achieve a high level of security, the challenge is often to restrict their computational and communication effort.
We focus on the setting of two parties using additively homomorphic encryption, and only one holding the decryption key, with numerous applications in secure signal processing like secure privacy-protected face recognition, privacy-protected k-means clustering, and privacy-protected content recommendation [1]. Other applications are neural network classification for e-health, biometric matching, watermark detection, fingerprinting for DRM, and smartgrids [1].
Within all those applications, there is clear need for a secure comparison protocol as a building block [1]. A few secure protocols based on homomorphic encryption are known for comparing two integers, the so-called millionaires problem. We present a new comparison protocol, which is dedicated to lightweight environments that require little memory and a low computational effort. For this reason, we focus on the semi-trusted model where both players follow the required protocol steps. As far as we know, this protocol is the solution with the lowest number of modular multiplications (of two additively homomorphic encrypted numbers) by now. The main reason is that our protocol does not need intermediate decryptions, which are computationally expensive.
First, the problem definition and notations are explained in the preliminaries. Then, an overview is presented on the most important related work. The actual comparison protocol called LSIC (Lightweight Secure Integer Comparison) is presented in the second section, its correctness and security are proven in Section 3. In Section 4, the computational, communication and storage complexity of our solution is analyzed, counting the total number of multiplications, transmissions, and storage of encryptions. These complexity parameters are compared with the most important alternative solutions in Section 5. In Section 6, it is shown how any comparison protocol can be transferred to the client-server model in an efficient and secure way. The final section contains the conclusions.

1.1. Preliminaries

We consider two parties, A and B, both having a private integer, respectively, a and b. Both parties would like to know which of their integers is the largest one, without revealing its value to the other party. This problem is called the millionaires problem. Since we are especially interested in lightweight environments, we assume both players are honest but curious.
The output of our secure multiparty computation protocol is the bit t such that { t = 1 } { a < b } . We consider different variants with different types of output:
  • The value t becomes known to both A and B.
  • A obtains the value t encrypted by a public key (homomorphic) cryptosystem, and B holds the private key K.
  • A and B share the output, i.e., they both have a private output bit, respectively, t A and t B , such that t = t A t B (⊕ denotes exclusive or).
In the last two variants, the value t is not known to A and B, but it enables them to use the output for other applications. For the public key cryptosystem used in our protocols, any additively homomorphic and semantically secure cryptosystem could be used. In our notation, we consider two classes of encryption systems, namely [ . ] to denote the encryption of a single bit with, e.g., Goldwasser-Micali (GM) [2,3], and [ [ . ] ] to denote encryption of integers with, e.g., Pallier [4] or Damgård, Geisler, and Krøigaard (DGK) [5,6,7].
Besides the model where both parties know their private integer, we also consider the client–server model. In this model, party A is the client who has both integers, but only in encrypted form, and B is the server, who owns the private key of the cryptosystem. In the client–server model, both parties are not allowed to learn the value of the integers a and b, and the same variants as above apply for obtaining the output t. Such a model is often used in privacy protecting applications where intermediate values should remain unknown, e.g., in face recognition [8].
Let N be the modulus of the encryption system, which is usually equal to the product of two large primes. We recall an important property of homomorphic encryption systems, namely that for bits x and y we have [ x ] · [ y ] = [ x y ] mod N , and for integers x and y we have [ [ x ] ] · [ [ y ] ] = [ [ x + y ] ] mod N . An encrypted integer is negated most efficiently by using the Euclidean algorithm [9]. This is denoted by [ [ x ] ] [ [ x ] ] 1 mod N . During the complexity computations, we assume that N is 1024 bits long, and that any security wise comparable symmetric encryption system has a key size of 80 bits [10]. For other key lengths, similar complexity conclusions can be drawn. For convenience, we neglect in our notation that the cipher text size in Pallier is N 2 and use N instead, just like in DGK or RSA.
In DGK and other similar cryptosystems, an integer x is encrypted by computing [ [ x ] ] = g x · h r mod N , where g and h are fixed public generators, and r is a secret random number chosen by the encrypting person. In GM, a bit x is encrypted by computing [ x ] = g x · r 2 mod N where g is a fixed public integer (quadratic nonresidue) of log 2 N bits, and r is a secret random number of the same size, chosen by the encrypting person. In both cryptosystems, the variable r is used to randomize the outcome of the encryption, so two encryptions of the same value will not be recognized as such. This is also the reason that within a cryptographic protocol, where encryptions are received from the other party, processed within local computations, and subsequently returned, encryptions need to be re-randomized before returning.
We use pseudo-code to describe the protocols. Assertions between { . } are used to describe the current value of variables. Additionally, comments are used, prefixed by ▹, to explain the corresponding line of the protocol. Each statement is prefixed by A or B, indicating the party that performs the statement. e.g., A: [ [ τ ] ] [ [ 1 ] ] · [ [ t ] ] mod N means that A multiplies the (encrypted) variable [ [ t ] ] with an encrypted 1 modulo N, and stores the result in the (encrypted) variable [ [ τ ] ] .
To compute the computational complexity of the different protocols, we use the fact that an exponentiation modulo N with an exponent of n bits will on average take 3 2 n multiplications modulo N. When the factoring of N is known, this can be reduced to 3 4 n by using the Chinese remainder theorem [9]. Namely, a multiplication modulo N is assumed to be equivalent to four multiplications modulo one of the two prime factors. The effort for negating an encrypted number is considered negligible. A Pallier decryption takes 3 2 log 2 N multiplications modulo N [4]. A Pallier encryption of a plaintext of n bits will take 5 n + 5 log 2 N multiplications modulo N [4].
We use x ÷ y to denote the integer division of x by y, so x ÷ y = ( x x mod y ) / y . Let σ be the statistical security parameter, which value is usually chosen around 80. The maximum size of the input variables is denoted by . We assume all random variables are uniformly chosen.

1.2. Related Work

The first solution of the millionaires problem is by Yao [11] in 1982. His solution, based on garbled circuits, has been improved many times since.
Most solutions are either based on homomorphic encryption or on garbled circuits. In Section 5, we describe one of the best candidates for both categories, and compare it with our solution LSIC. The candidate that uses homomorphic encryption is by Damgård, Geisler, and Krøigaard [5,6,7], who use a dedicated cryptosystem finetuned for small plaintext values. Their protocol is described in detail in Section 5.2 and compared to our work. One of the most efficient implementations nowadays based on garbled circuits is described by Kolesnikov, Sadeghi and Schneider [12]. The general garbled circuit approach is described in Section 5.3, and their specific implementation is compared to our work.
Other related work is, e.g., by Fischlin [13], who describes a system that enables to compute the product (AND) of two quadratic residues. However, an error parameter λ is required to guarantee the correctness of the result, which increases the computational and communication load, including decryptions.
Garay, Schoenmakers and Villegas [14] describe a nice solution for the client-server setting in the multi-party case, but since they use the malicious adversary model instead of the honest-but-curious model, their solutions are less efficient.
More recent results focus on the malicious adversary model [15], or other techniques, such as fully homomorphic encryption [16], which reduces communication, but increases computational efforts, or oblivious transfers [17].
Kerschbaum and Terzidis (KT) present an efficient solution to the millionaires problem in the semi-trusted model in [18], as described in detail in Section 5.1. This solution is later extended to multiple parties by Kerschbaum, Biswas and de Hoogh [19].

2. Comparison Protocol

Suppose party A has a private unencrypted number a, and party B has a private and unencrypted number b. The integers a and b have size . We denote their bits by a i and b i , for 0 i < , where a 0 and b 0 are the least significant bits. We use the notation a l ( 1 l ) to denote the integer i = 0 l 1 a i 2 i , i.e., the first l bits of a, and the same for b. Note that a = a and b = b .
The idea behind our comparison protocol [20] is to compute the bits t i , from i = 1 towards i = , where ( t i = 1 ) ( a i < b i ) . The bit t i + 1 can be computed from t i by using the relation:
( t i + 1 = 1 ) ( a i < b i )   or   { ( a i = b i )   and   ( t i = 1 ) }
The correctness of this recurrence relation is easily seen by observing that a i and b i are the most significant bits of a i + 1 and b i + 1 , respectively.
In order to compute t = t , we propose the protocol Lightweight Secure Integer Comparison (LSIC), which is shown in Algorithm 1. Algorithm 1 contains assertions between { . } to describe the current value of variables. Additionally, comments are used, prefixed by ▷, to explain the protocol. The correctness of the protocol, i.e., the proof of the assertions, is shown in Section 3.1. The formal security proof, to show that A and B learned nothing more than a < b , is given in Section 3.2.
Algorithm 1 Lightweight secure integer comparison (LSIC).
Input A                    a = a 1 a 0
Input B                    b = b 1 b 0 and the decryption key K
Joined output        bit t, where ( t = 1 ) ( a < b )
Party B encrypts and randomizes b 0 and sends [ b 0 ] to A
if  a 0 = 0  then
    A: [ t ] [ b 0 ]
else
5:    A: [ t ] [ 0 ] ▷  [ t ] 1 , randomized in line 17
end if
{ ( t = 1 ) ( t 1 = 1 ) ( a 0 < b 0 ) }
for  i 1 , , 1  do▷ A computes t = t i + 1 from t = t i
     { t = t i }
10:    A blinds t = t i by tossing a fair coin c { 0 , 1 }
    if  c = 0  then
        A: [ τ ] [ t ]
    else
        A: [ τ ] [ 1 ] · [ t ] mod N ▷  τ 1 t
15:    end if
     { τ = c t i }
    A randomizes [ τ ] and sends it to B
    if  b i = 0  then
        B: [ t b ] [ 0 ] ▷  [ t b ] 1 , randomized in line 24
20:    else
        B: [ t b ] [ τ ]
    end if▷ B computed t b = τ · b i without decrypting [ τ ]
     { t b = τ · b i }
    B encrypts b i , randomizes [ t b ] , and sends both [ t b ] and [ b i ] to A
25:     { t b = ( c t i ) · b i }
    if  a i = c  then▷ A smartly unblinds t b
        A: [ t b ] [ t b ] · [ b i ] mod N ▷  t b t b b i
    end if
     { t b = ( 1 a i t i ) · b i }
30:    if  a i = 0  then
         { t b = ( 1 t i ) · b i }
        A: [ t ] [ t ] · [ t b ] mod N ▷  t t t b
    else
         { t b = t i · b i }
35:        A: [ t ] [ t b ]
    end if
     { t = t i + 1 }
end for
{ t = t }
40:A sends [ t ] to B so B can decrypt it and send t = t back to A
Party A and B encrypt single bits by [ . ] , but only party B can decrypt. The main idea is that A uses variable [ t ] , which is the encryption of t i , and computes, in a joined protocol with B, [ t ] . This computation is done recursively, starting with [ t 1 ] , [ t 2 ] until [ t ] . In order for A to compute the next value, B sends the encrypted bits [ b i ] in line 24, but since this is not enough for A, as he is computing in the encrypted domain, B also sends the encryption of t b , being the product of b i and t i . To compute the product t b , A sends a blinded version of t i to B in line 17, because each intermediate value t i should be unknown to B (and A). The product is smartly unblinded again by A in line 27. Although the computations by A in lines 27 and 32 are not obvious, in Section 3.1, it is shown that A indeed correctly computes the next value [ t i + 1 ] from [ t i ] , a i , [ b i ] , and [ b i · t i ] . The computation in line 27 is actually an efficient combination of two similar statements:
{ t b = ( c t i ) · b i }
if  c = 1  then▷ A unblinds t b
    A: [ t b ] [ t b ] · [ b i ] mod N ▷  t b t b b i
end if
{ t b = t i · b i }
if  a i = 0  then
    A: [ t b ] [ t b ] · [ b i ] mod N ▷  t b t b b i
end if
{ t b = ( 1 a i t i ) · b i }
Since each statement is the inverse of the other one (as proved in Section 3.1), a double execution should be avoided. Only when c 1 a i , i.e., a i = c , one execution is necessary.
This protocol works for any number of bits . Since the protocol doesn’t require intermediate decryptions, the computational complexity is low. Algorithm 1 computes a < b , but also a b is similarly computed by letting A compute a 2 a and B: b 2 b in the beginning, and flipping the value of t at the end by B: t 1 t . The encryption system should be homomorphic and semantically secure. We use GM, because encryption and re-randomization are easy, but one could also use, e.g., Pallier or DGK. This requires a small modification of the homomorphic operations on encrypted numbers, as depicted in Table 1 below, where [ [ . ] ] is used to denote Pallier encryption.
The modified operation in line 27 works, because t b = τ · b i , so b i t b . The modified operation in line 32 works, because in this case ( a i = 0 ), t b = ( 1 t i ) · b i , so whenever t = t i = 1 , we have t b = 0 . Therefore, the addition of t and t b cannot exceed 1.
When the output t = t has to remain secret to both players, obviously the final step of the protocol at line 40 can be skipped. This also saves the (only) costly decryption by B. When the output has to be secretly shared among both players, the final step has to be modified slightly:
A blinds t = t by tossing a fair coin c { 0 , 1 }
if  c = 0  then
    A: [ τ ] [ t ]
else
    A: [ τ ] [ 1 ] · [ t ] mod N ▷  τ 1 t
end if
{ τ = c t }
A: t A c
A sends [ τ ] to B
B decrypts [ τ ]
B: t B τ
{ t = t A t B }
All homomorphic systems consist of an encryption and a randomization part, e.g., in GM [ x ] = g x · r 2 mod N , where g is a fixed integer (quadratic nonresidue) and r is randomly chosen. When implementing our comparison protocol, the randomization part can be skipped in most computations. Only when a value has to be sent to the other party (in lines 1, 17, 24, and 40), the result should be re-randomized.

3. Correctness and Security

3.1. Correctness

The number t = t i is blinded by A in line 14 by negating the bit with probability 1 2 , in which case τ = 1 t i (otherwise, τ = t i ). From τ , B computes t b = τ · b i . After receiving t b , A computes either t b = t i · b i or t b = ( 1 t i ) · b i depending on the value of a i . To see that the computation in line 27 has been done correctly, observe that the value of t b is toggled from t i · b i to ( 1 t i ) · b i and back by computing t b t b b i :
( ( 1 t i ) · b i ) b i = t i = 0 : b i b i = 0 t i = 1 : 0 b i = b i = t i · b i
The converse follows by substituting t i for 1 t i and vice versa. The correctness of the computation of t i + 1 (describing the relation a i + 1 < b i + 1 ) from t i in lines 32 and 35 follows from Table 2 below.
The first three rows show the eight possible values of the triplet ( t i , a i , b i ) . The last four rows are computed from the first three. For computing the row t i + 1 , the recurrence relation of Equation (1) is used. From the table follows that, for each value of the triplet ( t i , a i , b i ) , t i + 1 = t i t b when a i = 0 , and t i + 1 = t b otherwise.
It follows that in each iteration, the value of t i + 1 is correctly computed from the previous one, and thus that the decrypted value t at the end of the comparison protocol indeed equals the bit t = t , and therefore { t = 1 } { a < b } .

3.2. Security

In order to show that our protocol privately computes the comparison of two integers in the semi-honest model, we have to show that whatever can be computed by A or B from their view of a protocol execution, can be computed from their input and the comparison result (see Definition 7.2.1 in Goldreich [21]).
The view of A consists of its private number a, the size , the comparison bit t, the internal coin tosses c i , 1 i < , and all intermediate messages received from B: the encrypted bits [ b i ] , 0 i < , which are the encrypted bits of the number b, and the encrypted bits [ t b i ] , 1 i < , which equal [ b i · τ i ] , τ i being the blinded version of the bit ( a i < b i ) . Summarizing, the view of A equals
V A = ( a , , t , c 1 c 1 , [ b 0 ] [ b 1 ] , [ t b 1 ] , [ t b 1 ] )
It suffices to show that there exists a probabilistic polynomial-time algorithm S A such that S A ( a , , t ) is computationally indistinguishable from V A [21]. Since the encryption algorithm is semantically secure, every pair of encryptions is computationally indistinguishable, so by letting S A randomly generate 2 1 encryptions and 1 coin tosses, this condition is easily verified.
The view of B consists of its private number b, the decryption key K, the size , the comparison bit t, and all intermediate messages received from A: the blinded bits [ τ i ] , 1 i < , τ i being the blinded version of the bit ( a i < b i ) . Note that B also receives [ t ] in the end, but since this number doesn’t add anything to the view, we leave it out for convenience. Since B owns the decryption key, all encrypted values [ τ i ] can be decrypted to τ i . Additionally, B is able to deduce the randomization part of each encryption, but since A carefully uses re-randomization before each transmission, this information can be considered as a random variable and is therefore useless to B. Summarizing, the view of B is equivalent to
V B = ( b , K , , t , τ 1 , τ 1 )
Again, we have to show that there exists a probabilistic polynomial-time algorithm S B such that S B ( b , K , , t ) is computationally indistinguishable from V B . This is easily satisfied by letting S B randomly generate 1 bits. The derivation in Equation (2) shows that the bits τ i are indeed uniformly distributed.
In fact, we can even prove a much stronger assertion, namely that V B yields no more information regarding a than its inputs and output ( b , k , , t ) do, implying perfect (or information-theoretic) security for A towards B. This is due to the blinding technique of the numbers τ :
(i)
The bit t contains the value t i = ( a i < b i ) .
(ii)
A tosses a fair coin c, when head then τ 1 t else τ t .
(iii)
A sends τ to B.
To see that I ( b , K , , t ; a ) = I ( V B ; a ) , where I denotes the mutual information, we show that each τ is uniformly distributed.
Pr ( τ = 1 ) = Pr ( τ = 1 c = head ) · Pr ( c = head ) + Pr ( τ = 1 c = tails ) · Pr ( c = tails ) = Pr ( t = 0 ) · 1 2 + Pr ( t = 1 ) · 1 2 = 1 2
It’s easy to see that the random variable τ (and its uniform distribution) is independent of a, b, K, , t, or any previous value of τ , so the equality of mutual information follows.
We conclude that the private input of B is computationally secure towards A, and that the private input of A is unconditionally (so even with unbounded computation power) secure towards B.

4. Complexity

In this section, we compute the computational, communication, and storage complexity of our protocol. We assume that during the protocol, the randomization part r 2 is omitted where possible. In fact, only when an encrypted value is transmitted to the other party, this encrypted value has to be rerandomized, i.e., multiplied by a random square, such that two pairs of encrypted bits are indistinguishable. Note that although B owns the decryption key (also called private key), re-randomization is even necessary for A, because B might be able to recognize the randomization part.
The summary of the complexity analysis of our comparison protocol is depicted in Table 3. We ignore the efforts for key generation and key distribution.
The computational complexity is measured in the number of multiplications modulo N, the communication complexity is measured in the number of messages. Each message equals an encrypted bit and has a size of log 2 N bits. The storage complexity is measured in the number of encrypted numbers (of size log 2 N bits) to be stored. When the comparison result has to be known to both parties, we need an extra decryption of the comparison result by B, as depicted in the table above. If the output bit should be available in encrypted form, no decryptions are required. The unencrypted message of one bit (the comparison result) from B to A is neglected in our analysis.
An important observation is that the (maximal) number of multiplications modulo N is even less than the number of modular multiplications needed for the Pallier encryption of an ( < N ) bit number: 5 l + 5 log 2 N [4].

4.1. Computational Complexity

We compute the computational complexity by counting the number of multiplications modulo N, since these form the main computational load. Due to the construction of GM, the encryption of 0 requires one multiplication (squaring) modulo N, and the encryption of 1 requires two multiplications modulo N. A decryption of [ x ] to x requires the computation of the Jacobi symbol ( [ x ] N ) , which equals the product of the Legendre symbols ( [ x ] p ) and ( [ x ] q ) . The Legendre symbol ( [ x ] p ) is equivalent to [ x ] ( p 1 ) / 2 modulo p, and therefore requires approximately 3 2 log 2 p multiplications modulo p. A multiplication modulo N is more intensive, and requires more or less four multiplications modulo p (or q), such that the total number of multiplications modulo N for one GM decryption is estimated by 3 2 · 1 4 log 2 p + 3 2 · 1 4 log 2 q = 3 8 log 2 N .
The expected number of multiplications (in the encrypted domain) for A in this protocol equals 1 times: 0.5 for the blinding of t i in line 14, 2 for the re-randomization of [ τ ] in line 17, 0.5 for the possible conversion of [ t b ] in line 27, and 0.5 for the computation of [ t i + 1 ] in line 32. Together with 2 for the final re-randomization of [ t ] in line 40, for a total of 3.5 ( 1 ) + 2 multiplications. The expected computational load for B equals the encryptions of b i in lines 1 and 24, and 1 re-randomizations of [ t b ] in line 24, for a total of 1.5 + 1.5 ( 1 ) = 3 ( 1 ) + 1.5 multiplications.
The actual number of multiplications depends on the (bit) values of a and b. Since timing attacks might reveal some information about these numbers, we also mention the maximal number of multiplications, which are computed similarly and equal 4 ( 1 ) + 2 for both A and B. This maximum for B is achieved when each bit b i of b is zero, because then the encryption of b i will take 2 multiplications, as well as the randomization of [ t b ] . For A, we have to take a closer look at lines 14, 27 and 32 and their conditions c = 1 , a i = c and a i = 0 , respectively. One can see that at most two of these three conditions will hold for each i in the for loop. This will be the case when either c = 1 or a i = 0 .
No intermediate decryptions are needed in the protocol. Only when the end result [ t ] has to be available in plain text, or a conversion to another encryption system is needed (see e.g., the client–server solution in Section 6), one decryption by B is desired at the end which costs approximately 3 8 log 2 N multiplications modulo N.
Some values can be precomputed to reduce the number of multiplications, but this requires more storage capacity. All encryptions and all random parts (the squarings) can be precomputed and stored.

4.2. Communication Complexity

The numbers that are sent in our protocol are all single bits encrypted by the GM system, resulting in encrypted numbers of log 2 N bits.
A sends to B 1 times the value of [ τ ] , and once the number [ t ] , for a total of numbers of log 2 N bits. B sends to A the number [ b 0 ] , and 1 times the numbers [ b i ] and [ t b ] , for a total of 2 1 numbers of log 2 N bits. Our protocol takes communication rounds (plus half a round in the first step).

4.3. Storage Complexity

We count the number of encrypted values that have to be stored, since plain integers are relatively small.
A has to store the current values of [ b i ] , [ t i ] and [ t b ] , requiring three storage units. When [ τ ] is computed, the storage unit of [ t b ] can be used so this doesn’t require an extra storage unit. B has to store [ t b ] and [ b i ] , requiring two storage units. When [ τ ] is received, this can be stored in the storage unit of [ t b ] avoiding an extra storage unit.
The storage complexity expands when using precomputations to store encryptions of known bits, or some random squares used for re-randomization. The total number of storage units will depend on the implementation and the requirements with respect to waiting time, communication, computation and storage capacities.

5. Alternative Solutions

In this section, we compare our comparison protocol, the Lightweight Secure Integer Comparison (LSIC), with other solutions for solving the millionaires problem. Since we are only interested in the most efficient solutions, we restrict ourselves to the semi-honest model. In the literature, we find two main classes of solutions that use public key cryptography, namely one based on homomorphic encryptions, and one based on garbled circuits. We compare our solution to the best representatives in each category.

5.1. KT

Kerschbaum and Terzidis (KT) present an efficient solution to the millionaires problem in the semi-trusted model in [18]. Their cryptographic protocol is depicted in Algorithm 2. Party A computes the Pallier encrypted difference x = b a and lets B decide whether x 0 . They use the upper half [ N + 1 2 , N ) of the plain text range to represent negative numbers. Since B is not allowed to learn x, A uses multiplicative blinding (which preserves the sign of x) in line 5 to hide it for B. To prevent x from exceeding N + 1 2 , is bounded by 3 + 1 < N + 1 2 . The main disadvantage is that multiplicative hiding is not perfect and leaks some information about x, and thus a, to B [22].
We compute the computational complexity of KT to compare it with our solution LSIC. In line 2, b is encrypted by Pallier, a number of bits. In line 5 a number of 3 bits is encrypted, and an exponentiation is computed to the power r which has 2 bits, and in line 8, the number x is decrypted. Therefore, the total number of multiplications modulo N is ( 5 + 5 log 2 N ) + ( 5 · 3 + 5 log 2 N ) + 3 2 · 2 + 3 2 log 2 N = 23 + 23 2 log 2 N . This computational complexity is better than the other alternatives, but worse than LSIC. Although the communication complexity of KT is very good, its weaker notion of security is a serious drawback.
Algorithm 2 Kerschbaum and Terzidis (KT).
Input A          integer a
Input B          integer b and the decryption key K
Joined output        bit t, where ( t = 1 ) ( a b )
{Both a and b consist of bits}
B encrypts b and sends [ [ b ] ] to A
A chooses random number r of 2 bits
A chooses random number r such that 0 r < r
5:A: [ [ x ] ] [ [ b ] ] r · [ [ r · a r ] ] 1 mod N ▷  x r · ( b a ) + r mod N
{ ( a b ) ( x < N + 1 2 ) }
A sends [ [ x ] ] to B
B decrypts [ [ x ] ]
if  x < N + 1 2  then
10:    B: t 1
else
    B: t 0
end if
{ ( t = 1 ) ( x < N + 1 2 ) }
15:B sends t to A
{ ( t = 1 ) ( a b ) }

5.2. DGK

The DGK (Damgård, Geisler, and Krøigaard) protocol [5,6,7], which is actually inspired by Blake and Kolesnikov [23] is depicted in Algorithm 3.
Algorithm 3 The Damgård, Geisler, and Krøigaard (DGK) comparison protocol.
Input A        a = a 1 a 0
Input B        b = b 1 b 0 and the decryption key K
Joined output      bit t, where ( t = 1 ) ( a < b )
Party B encrypts the bits b i , 0 i < and sends all [ [ b i ] ] to A.
for all  0 i <  do▷ A computes the bitwise exclusive or’s
    if  a i = 0  then
        A: [ [ x i ] ] [ [ b i ] ]
5:    else
        A: [ [ x i ] ] [ [ 1 ] ] · [ [ b i ] ] 1 ▷  x i 1 b i
    end if
     { x i = a i b i }
end for
10:for all  0 i <  do
    A encrypts a i + 1
    A: [ [ c i ] ] [ [ a i + 1 ] ] · [ [ b i ] ] 1 · j = i + 1 1 [ [ x j ] ] mod N
    { c i = a i + 1 b i + j = i + 1 1 a j b j }
    A blinds c i towards B by raising [ [ c i ] ] to a random non-zero number
15:end for
A randomly permutes the numbers [ [ c i ] ] and sends them to B
B checks whether one of them is zero, and returns the result t to A
{ ( t = 1 ) ( there   is   an   i   such   that   c i = 0 ) ( a < b ) }
The main idea of DGK is to search, from left to right, for the first position i where the bits of a and b differ. When a i < b i , as indicated by c i = 0 , then a < b . All other numbers c j , j i will be positive. The values and order of the numbers c i have to be blinded because they reveal some information about a towards B. They use a special homomorphic encryption system that is finetuned to small plaintext sizes u and enables efficiently checking whether encrypted values are zero [6].
There is an important computational improvement in Algorithm 3, which is not mentioned by Damgård, Geisler, and Krøigaard, based on the observation that the number c i can only be zero when a i = 0 . This implies that A only has to compute the numbers [ [ c i ] ] for which a i = 0 . For the other numbers [ [ c i ] ] , an encrypted, non-zero random number can be chosen. This will save some modular multiplications for A.
The computational complexity of the DGK protocol is analyzed as follows:
(i)
The bitwise exclusive or’s have to be computed for the bits of a and b. This takes on average 1 2 multiplications.
(ii)
From the exclusive or’s, the numbers c i have to be computed. This can be done in 3 multiplications, by storing the intermediate result of j = i + 1 1 [ [ x j ] ] .
(iii)
The numbers c i have to be blinded, i.e., raised to a random number of length u [6]. This step can be done efficiently due to the smartly chosen encryption system. The number u is relatively small and equal to the first prime larger than + 2 . The blinding takes around 3 2 · log 2 u multiplications.
These estimates are based on the idea that in case one has to raise a number to an exponent of n bits, this will take on average 3 2 n multiplications.
When taking u, the plaintext size, equal to + 2 , we come up with a total of 7 2 + 3 2 log 2 ( + 2 ) multiplications, which is of order log 2 (due to the blinding of the numbers c i ).
These are all multiplications on the account of A. For B, the main computational load is in decrypting the received numbers. B receives the blinded numbers c i and has to decrypt them to decide whether one of them is zero or not. Therefore, a full decryption is not required, only a check whether the encrypted value is zero or not. This is relatively easy in the DGK encryption system, and is equivalent to raising each c i to the power v, which is a number of size t = 160 [6]. By using the factorization of N while decrypting, the total number of multiplications for B is about 1 2 · 3 2 · · t = 120 . Unless is very large, the decryptions (by B) determine the main computational load of the DGK protocol.
The encryptions by A and B are easy, except for the randomization part, which is done when sending the encrypted value to the other party. (Re)randomizations in the DGK encryption system are roughly equivalent to raising a number to an exponent of size t = 160 bits [6], so we estimate each randomization by 3 2 t multiplications modulo N. Each party has to (re)randomize numbers.
In the DGK protocol, A sends to B the numbers [ [ c i ] ] , and B sends to A the numbers [ [ b i ] ] , and the final result t (which is only one bit). So the communication load from B to A is instead of our 2 1 . More importantly, the DGK protocol takes only one (and a half) round.
In the DGK protocol, A has to store the numbers [ [ c i ] ] , and [ [ b i ] ] , for a total of 2 storage units. Party B has to store the numbers [ [ c i ] ] before they can be decrypted, for a total of storage units. The storage complexity can be reduced by increasing the number of communication rounds, but it can not be less than linear in , because the order of the numbers [ [ c i ] ] has to be randomized towards B.
The DGK protocol offers perfect (unconditional) security for B towards A, because A only receives blinded values, and computational security for A towards B, protected by the semantically secure encryption system.

5.3. Garbled Circuits

The millionaires problem could also be solved by using some form of garbled circuits. The main components of such a solution are:
(1)
A creates a garbled circuit for comparing two bits numbers and sends it to B. The private inputs of A are incorporated by using only the corresponding input wires.
(2)
For each input bit of B, A and B perform an (1 out of 2) oblivious transfer protocol so B can use the correct input wire of the garbled circuit.
(3)
B evaluates the garbled circuit, which results in one output wire.
(4)
B sends (a part of) the output wire to A, which translates this to the result of the comparison.
The computationally most intensive step is the oblivious transfer of the input bits of B (step 2), since this involves asymmetric cryptography, while evaluation of the circuit can be efficiently done with symmetric techniques. The most efficient implementations of step 2 are based on Elliptic Curve Cryptography (ECC), in which case at least one ECC encryption and decryption is needed per input bit. In [24], it is estimated that one ECC encryption plus decryption is comparable to 200 multiplications modulo an 1024 bit number, when considering a security level similar to an RSA number of 1024 bits, which in ECC corresponds with a 160 bits modulus.
It must be noted that the computational complexity of GC can be considerably reduced by using precomputations, but this is considered out of scope for the environments we are interested in.
The communication complexity of one of the best known GC solutions [12] is 19 · t , where t is the usual key size of symmetrical cryptosystems (we use t = 80 ). The circuit here is also based on our recurrence relation that is depicted in Equation (1).
The storage complexity of GC is more or less equal to the communication complexity, since the communicated garbled circuit, and the obliviously transferred values have to be stored separately. However, when using more communication rounds, where in each round the oblivious transfer values and the garbled circuit part with respect to one bit is communicated, the storage complexity could be reduced to approximately 19 · t · 2 , i.e., 19 · t bits per party.
Although other variants of garbled circuits exist, the most efficient implementation considered here works in the semi-honest model, and offers computational security for both parties. Furthermore, the solution considered here uses a weak form of Random Oracle, namely of correlation-robust functions [12].

5.4. Summary

A rough summary of the previous subsections is depicted in Table 4.
The size of the asymmetric modulus (used in LSIC, KT, and DGK) was chosen as 1024 bits, 160 bits for the elliptic curves used in the oblivious transfer part of GC, and 80 bits for the symmetric systems used in the circuit evaluation. The amount of computation is measured as the number of multiplications modulo a 1024 bit number. The amount of communication and storage is in bits. The computational load of GC is a lower bound, since only one ECC encryption and decryption (per input bit) is counted, which is needed in the oblivious transfer part.
The comparison of the computational complexity of the four solutions is visualized in Figure 1. The amount of multiplications needed for (re)randomization is incorporated here too.
When comparing LSIC with other solutions, it’s clear that both computational and storage complexity is much smaller than for existing solutions, while the communication complexity is slightly larger. The large computational effort of the Paillier decryption during KT can be clearly seen in Figure 1, and shows our motivation for finding a solution like LSIC that does not require one.
Compared to KT, DGK, and GC, which are constant round solutions, LSIC uses a linear (in ) number of communication rounds. Although extra rounds could lead to delays between rounds depending on the implementation, it offers a significant reduction in storage complexity.

6. Client-Server Model

The LSIC protocol could, like most comparison protocols, also be used in the client–server model. Although we focus on LSIC, the same approach could be used for converting any comparison protocol to the client–server model. We also discuss some variations of the client–server protocol, as depicted in Algorithm 4, making it suitable for different types of output.
Assume A has two encrypted numbers [ [ a ] ] and [ [ b ] ] of bits, party B has the private key, and they want to compare the numbers a and b. The actual values of a and b are not known to A and B. Note that [ [ . ] ] is used to denote the encryption scheme (e.g., Pallier), which differs from GM, because a and b consist of more than one bit.
The main idea of Algorithm 4 is that the most significant bit of x = b + 2 a indicates whether a b . Since x is an + 1 bit number, its most significant bit equals x ÷ 2 . In line 2, the number x is statistically blinded by the random number r, which should contain σ more bits than x. Since we don’t allow carry-overs modulo N when computing x, this protocol only works whenever + 1 + σ < log 2 N . In line 9 of Algorithm 4 we use the LSIC protocol to compute c < d . Since its output t should remain unknown to A and B, to protect the privacy of a and b, we use the output variant where A obtains the encrypted value [ t ] . The correctness of Algorithm 4, i.e., the proof of the assertions, and the formal security proof, is given in later subsections. Algorithm 4 computes a b , but also a < b could be similarly computed by swapping a and b in the computation of x and flipping t at the end, which is most easily done by flipping r + 1 (by A) or z + 1 (by B) before encrypting it.
Algorithm 4 Client–server comparison.
Input A      [ [ a ] ] and [ [ b ] ]
Input B     the decryption key K
Output A     encrypted bit [ t ] , where ( t = 1 ) ( a b )
{Both a and b consist of bits}
A: [ [ x ] ] [ [ b ] ] · [ [ 2 ] ] · [ [ a ] ] 1 mod N ▷  x b + 2 a
A chooses a random number r of + 1 + σ bits for blinding x
A: [ [ z ] ] [ [ x ] ] · [ [ r ] ] mod N ▷  z x + r
5:A sends [ [ z ] ] to B
B decrypts [ [ z ] ]
A: c 2 r mod 2
B: d 2 z mod 2
A: [ t ] L S I C ( c , d )
10: { ( t = 1 ) ( c < d ) }
B encrypts z + 1 and sends [ z + 1 ] to A▷  z + 1 is the ( + 1 ) -th bit of z
A encrypts r + 1 ▷  r + 1 is the ( + 1 ) -th bit of r
A: [ t ] [ z + 1 ] · [ r + 1 ] · [ t ] mod N ▷  t z + 1 r + 1 t
{ t = x ÷ 2 }
This client–server protocol only needs one decryption, namely the Pallier decryption in line 6. In addition to LSIC, which is executed in line 9, only five extra multiplications modulo N are needed (and two GM encryptions), so this client–server protocol has a very low overall computational complexity. In other known solutions, like the client–server protocol by Erkin et al. in [8], the number x ÷ 2 is computed via the number x mod 2 , which requires a division of an encrypted number by 2 , and thus an exponentiation to a number of size log 2 N , which requires substantially more modular multiplications.
Note that although the inputs are encrypted by Pallier, the output is encrypted by QR. It’s also possible to obtain the output encrypted by Pallier by replacing lines 11 to 13 by the following lines:
B computes z ÷ 2 , encrypts it with Pallier, and sends [ [ z ÷ 2 ] ] to A
A encrypts r ÷ 2 with Pallier
A: [ [ t ] ] [ [ z ÷ 2 ] ] · [ [ r ÷ 2 ] ] 1 · [ [ t ] ] 1 mod N ▷  t ( z ÷ 2 ) ( r ÷ 2 ) t
{ t = x ÷ 2 }
The only problem with this solution is that the output [ t ] of the comparison protocol in line 9 is encrypted by QR, while Pallier encryption is needed in line 13. To overcome this problem, one solution is to run LSIC entirely with Pallier encrypted bits. This introduces some extra computations for the encryptions and re-randomizations. A computationally less intensive solution is to convert the QR encrypted output bit at the end into a Pallier encryption. This requires a modification of the final line, number 40, of Algorithm 1:
{ [ t ] is the QR encrypted bit t }
A blinds [ t ] by tossing a fair coin c { 0 , 1 }
if  c = 0  then
     A: [ τ ] [ t ]
else
     A: [ τ ] [ 1 ] · [ t ] mod N ▷  τ 1 t
end if
{ τ = c t }
A sends [ τ ] to B
B decrypts [ τ ] , encrypts it with Pallier [ [ . ] ] , and sends [ [ τ ] ] to A
if  c = 0  then
     A: [ [ t ] ] [ [ τ ] ]
else▷ A unblinds t
     A: [ [ t ] ] [ [ 1 ] ] · [ [ τ ] ] 1 mod N ▷  t 1 τ
end if
{Now [ [ t ] ] is the Pallier encrypted bit t }
It’s also possible to obtain the comparison result in the client–server model as a shared secret. To this end, the final lines of Algorithm 4, starting with line 9, have to be modified slightly:
  • ( t A , t B ) L S I C ( c , d )
  • { ( t A t B = 1 ) ( c < d ) }
  • A: t A r + 1 t A
  • B: t B z + 1 t B
  • { t A t B = x ÷ 2 }
The shared output solution saves two multiplications by A, and one encryption and transmission of the number [ z + 1 ] by B. On the other hand, the shared output version of LSIC requires an extra blinding action and transmission by A and also an extra decryption by B.

6.1. Correctness

Since x = b + 2 a , it is clear that the most significant bit of x, i.e., x ÷ 2 , will be equal to the comparison result of a b , i.e., x ÷ 2 = 1 if and only if a b , since both a and b are bits long. This proves that the assertion in line 14 indeed gives the correct output.
In order to understand line 13, where the number x ÷ 2 is computed, both in the QR encrypted and the Pallier encrypted version, observe that for each positive integer x, the number x ÷ 2 is defined by x = 2 · ( x ÷ 2 ) + x mod 2 such that 0 x mod 2 < 2 . Since
z = x + r = 2 · ( x ÷ 2 ) + x mod 2 + 2 · ( r ÷ 2 ) + r mod 2 = 2 · ( ( x ÷ 2 ) + ( r ÷ 2 ) ) + ( ( x mod 2 ) + ( r mod 2 ) )
we know that z ÷ 2 = ( x ÷ 2 ) + ( r ÷ 2 ) and z mod 2 = ( x mod 2 ) + ( r mod 2 ) whenever ( x mod 2 ) + ( r mod 2 ) < 2 , and z ÷ 2 = ( x ÷ 2 ) + ( r ÷ 2 ) + 1 and z mod 2 = ( x mod 2 ) + ( r mod 2 ) 2 , otherwise. In the first case, z mod 2 = ( x mod 2 ) + ( r mod 2 ) r mod 2 . In the second case, z mod 2 = ( x mod 2 ) + ( r mod 2 ) 2 < r mod 2 . So
z ÷ 2 = ( x ÷ 2 ) + ( r ÷ 2 ) ( x mod 2 ) + ( r mod 2 ) < 2 z mod 2 r mod 2 d c t = 0
The relation
x ÷ 2 = ( z ÷ 2 ) ( r ÷ 2 ) t
easily follows, which shows the correctness of line 13 in the Pallier encrypted version. The correctness in the QR encrypted version follows by observing that z ÷ 2 = z + 1 + σ z + 1 = 2 · ( z + 1 + σ z + 2 ) + z + 1 , so ( z ÷ 2 ) mod 2 = z + 1 . Since x ÷ 2 is a bit value, we have x ÷ 2 = ( ( z ÷ 2 ) ( r ÷ 2 ) t ) mod 2 = ( z + 1 r + 1 t ) mod 2 , so
x ÷ 2 = z + 1 r + 1 t
The correctness of the shared output version of the client–server protocol also follows immediately from this equation.

6.2. Security

We prove the security of the first mentioned variant of the client–server protocol as depicted in Algorithm 4. The proof of the other variants is similar.
In order to show that our protocol privately computes the comparison of two integers in the semi-honest model, we have to show that whatever can be computed by A or B from their view of a protocol execution, can be computed from their input and the comparison result (see Definition 7.2.1 in Goldreich [21]).
The view of A consists of the encrypted numbers [ [ a ] ] and [ [ b ] ] , the size , the random number r, the encrypted comparison bit [ t ] , and all intermediate messages received from B. Besides [ z + 1 ] , this also includes all intermediate messages in the LSIC subprotocol: the encrypted bits [ d i ] , 0 i < , which are the encrypted bits of the number d, and the encrypted bits [ t d i ] , 1 i < , which equal [ d i · τ i ] , τ i being the blinded version of the bit ( c i < d i ) . Summarizing, the view of A equals
V A = ( [ [ a ] ] , [ [ b ] ] , , r , [ t ] , [ z + 1 ] , [ d 0 ] [ d 1 ] , [ t d 1 ] , [ t d 1 ] )
It suffices to show that there exists a probabilistic polynomial-time algorithm S A such that S A ( [ [ a ] ] , [ [ b ] ] , , [ t ] ) is computationally indistinguishable from V A [21]. Since both encryption algorithms are semantically secure, every pair of encryptions is computationally indistinguishable, so by letting S A randomly generate 2 encryptions and one random number with the same distribution as r, this condition is easily verified.
The view of B consists of the decryption key K and the size , and all intermediate messages received from A. Besides [ [ z ] ] , this also includes all intermediate messages in the LSIC subprotocol: the blinded bits [ τ i ] , 1 i < , τ i being the blinded version of the bit ( c i < d i ) . The comparison result x ÷ 2 and the intermediate comparison result t are not received by B. Since B owns the decryption key, all encrypted values [ τ i ] can be decrypted to τ i , just like the number z. Additionally, B is able to deduce the randomization part of each encryption, but since A carefully uses re-randomization before each transmission, this information can be considered as a random variable and is therefore useless to B. Summarizing, the view of B is equivalent to
V B = ( K , , z , τ 1 , τ 1 )
Again, we have to show that there exists a probabilistic polynomial-time algorithm S B such that S B ( K , ) is computationally indistinguishable from V B . In Equation (2), it was shown that the bits τ i are uniformly distributed, so we could let S B generate 1 random bits for those. The number z is a number of l + 1 + σ bits, but is, due to its construction, statistically indistinguishable from a random number of equal length, which means that the difference between both probabilities is bounded by 2 σ . Therefore, we can even prove the stronger assertion that S B ( K , ) is statistically indistinguishable from V B .
We conclude that the private input of B is computationally secure towards A, and that the private input of A is statistically secure towards B. We use the term statistically secure instead of perfectly secure, although the private input of A is secure even when B has unbounded computer power. The difference with perfect security is that the amount of information leakage is not zero, but negligible.

7. Conclusions

We described a new protocol for the millionaires problem using additively homomorphic encryption in the honest-but-curious model. There are no restrictions on the size of the inputs. Since this protocol based on homomorphic encryption doesn’t use intermediate decryptions, it has the lowest number of modular multiplications of all known solutions, and also a low communication and storage complexity, making it preferable for light-weight environments. The (maximal) number of multiplications modulo N is even less than the number of modular multiplications needed for the Pallier encryption of an bit number. The number of communication rounds is equal to the number of input bits. The private input of the first player (A) is computationally secure towards the second player (B), and the private input of the second player is even perfectly secure towards the first player. Furthermore, we showed how to transform any comparison protocol to the client–server model in an efficient and secure way. The client–server solution offers computational security for B, and even statistical security for A. We showed three output variants for both the private input as the client-server model, namely a publicly known output, an encrypted output, and a secret-shared output.

Funding

This research received no external funding.

Informed Consent Statement

Not applicable.

Conflicts of Interest

The author declares no conflict of interest.

References

  1. Lagendijk, R.L.; Erkin, Z.; Barni, M. Encrypted Signal Processing for Privacy Protection. IEEE Signal Process. Mag. 2012, 30, 82–105. [Google Scholar] [CrossRef]
  2. Goldwasser, S.; Micali, S. Probabilistic encryption and how to play mental poker keeping secret all partial information. In Proceedings of the 14th ACM Symposium on the Theory of Computing (STOC 1982); ACM: New York, NY, USA, 1982; pp. 365–377. [Google Scholar]
  3. Goldwasser, S.; Micali, S. Probabilistic encryption. J. Comput. Syst. Sci. 1984, 28, 270–299. [Google Scholar] [CrossRef] [Green Version]
  4. Paillier, P. Public-key cryptosystems based on composite degree residuosity classes. In Advances in Cryptology (EUROCRYPT 1999); Lecture Notes in Computer Science; Springer: New York, NY, USA, 1999; Volume 1592, pp. 223–238. [Google Scholar]
  5. Damgård, I.; Geisler, M.; Krøigaard, M. Efficient and Secure Comparison for On-Line Auctions. In Australasian Conference on Information Security and Privacy— Proceedings of the ACSIP 2007, 2–4 July 2007, Townsville, Australia; Pieprzyk, J., Ghodosi, H., Dawson, E., Eds.; Volume 4586 of LNCS; Springer: Berlin/Heidelberg, Germany, 2007; pp. 416–430. [Google Scholar]
  6. Damgård, I.; Geisler, M.; Krøigaard, M. Homomorphic encryption and secure comparison. J. Appl. Cryptol. 2008, 1, 22–31. [Google Scholar] [CrossRef]
  7. Damgård, I.; Geisler, M.; Krøigaard, M. A correction to efficient and secure comparison for on-line auctions. J. Appl. Cryptol. 2009, 1, 22–31. [Google Scholar] [CrossRef]
  8. Erkin, Z.; Franz, M.; Katzenbeisser, S.; Lagendijk, R.L.; Merchan, J.G.; Toft, T. Privacy-Preserving Face Recognition. In International Symposium on Privacy Enhancing Technologies Symposium; LNCS 5672; Springer: Berlin/Heidelberg, Germany, 2009; pp. 235–253. [Google Scholar]
  9. Menezes, A.J.; van Oorschot, P.C.; Vanstone, S.A. Handbook of Applied Cryptography; CRC Press: Boca Raton, FL, USA, October 1996; ISBN 0-8493-8523-7. [Google Scholar]
  10. Barker, E. Recommendation for Key Management: Part 1—General; NIST Special Publication 800-57; NIST: Gaithersburg, MD, USA, May 2020; Part 1, Revision 5. [Google Scholar]
  11. Yao, A.C. Protocols for secure computations. In Proceedings of the Symposium on Foundations of Computer Science (SFCS’82), Chicago, IL, USA, 3–5 November 1982; pp. 160–164. [Google Scholar]
  12. Kolesnikov, V.; Sadeghi, A.R.; Schneider, T. Improved Garbled Circuit Building Blocks and Applications to Auctions and Computing Minima. In International Conference on Cryptology and Network Security; Cryptology ePrint Archive, Report 2009/411; Springer: Berlin/Heidelberg, Germany, 2009. [Google Scholar]
  13. Fischlin, M. A cost-effective pay-per-multiplication comparison method for millionaires. In Cryptographers’ Track at the RSA Conference; Naccache, D., Ed.; Springer: Heidelberg, Germany, 2020; Volume 2020, pp. 457–472. [Google Scholar]
  14. Garay, J.; Schoenmakers, B.; Villegas, J. Practical and Secure Solutions for Integer Comparison. In Public Key Cryptography—PKC ’07; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2007; Volume 4450, pp. 330–342. [Google Scholar]
  15. Makri, E.; Rotaru, D.; Vercauteren, F.; Wagh, S. Rabbit: Efficient Comparison for Secure Multi-Party Computation; Financial Crypto; Springer: Berlin, Germany, 2021; pp. 249–270. [Google Scholar]
  16. Bourse, F.; Sanders, O.; Traoré, J. Improved Secure Integer Comparison via Homomorphic Encryption. In Proceedings of the RSA Conference 2020, San Francisco, CA, USA, 24–28 February 2020. Topics in Cryptology—CT-RSA 2020. [Google Scholar]
  17. Couteau, G. New protocols for secure equality test and comparison. In Applied Cryptography and Network Security; Springer: Berlin/Heidelberg, Germany, 2018. [Google Scholar]
  18. Kerschbaum, F.; Terzidis, O. Filtering for Private Collaborative Benchmarking, International Conference on Emerging Trends in Information and Communication Security. 2006. Available online: http://www.fkerschbaum.org/etrics06.pdf (accessed on 9 December 2021).
  19. Kerschbaum, F.; Biswas, D.; de Hoogh, S. Performance Comparison of Secure Comparison Protocols. In Proceedings of the 1st International Workshop on Business Processes Security, Linz, Austria, 31 August–4 September 2009; Available online: http://www.fkerschbaum.org/bps09a.pdf (accessed on 9 December 2021).
  20. Veugen, T. Comparing Encrypted Data; Delft University of Technology: Delft, The Netherlands, 2010; unpublished. [Google Scholar]
  21. Goldreich, O. Foundations of Cryptography, Volume II: Basic Applications; Cambridge University Press: Cambridge, UK, 2004. [Google Scholar]
  22. Bianchi, T.; Piva, A.; Barni, M. Analysis of the security of linear blinding techniques from an information theoretical point of view. In Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing, ICASSP 2011, Prague Congress Center, Prague, Czech Republic, 22–27 May 2011. [Google Scholar]
  23. Blake, I.F.; Kolesnikov, V. Strong conditional oblivious transfer and computing on intervals. In Advances in Cryptology, ASIACRYPT 2004, Proceedings of the 10th International Conference on the Theory and Application of Cryptology and Information Security, Jeju Island, Korea, 5–9 December 2004; Volume 3329 of LNCS; Springer: Berlin/Heidelberg, Germany, 2004; pp. 515–529. [Google Scholar]
  24. Robshaw, M.J.B.; Yin, Y.L. Overview of Elliptic Curve Cryptosystems. CryptoBytes Technical Newsletter; RSA Laboratories, 27 June 1997. Available online: http://www.rsa.com/rsalabs/node.asp?id=2013 (accessed on 9 December 2021).
Figure 1. Computational complexity.
Figure 1. Computational complexity.
Mathematics 10 00305 g001
Table 1. Operations and their encrypted counterpart.
Table 1. Operations and their encrypted counterpart.
OperationGMPallier
14: τ 1 t [ τ ] [ 1 ] · [ t ] [ [ τ ] ] [ [ 1 ] ] · [ [ t ] ] 1 { τ 1 t }
27: t b t b b i [ t b ] [ t b ] · [ b i ] [ [ t b ] ] [ [ b i ] ] · [ [ t b ] ] 1 { t b b i t b }
32: t t t b [ t ] [ t ] · [ t b ] [ [ t ] ] [ [ t ] ] · [ [ t b ] ] { t t + t b }
Table 2. Correctness of computing t i + 1 .
Table 2. Correctness of computing t i + 1 .
t i 01010101
a i 00001111
b i 00110011
t i + 1 01110001
t b = t i · b i 0001
t b = ( 1 t i ) · b i 0010
t i t b 0111
Table 3. Complexity overview.
Table 3. Complexity overview.
ComputationCommunicationStorage
AverageMaximal
A 3.5 ( 1 ) + 2 4 ( 1 ) + 2 1 3
B 3 ( 1 ) + 1.5 4 ( 1 ) + 2 2 1 2
Decryption 3 8 log 2 N 10
Total with encrypted [ t ] 6.5 ( 1 ) + 3.5 8 ( 1 ) + 4 3 2 5
Total with decrypted t 6.5 ( 1 ) + 3.5 + 3 8 log 2 N 8 ( 1 ) + 4 + 3 8 log 2 N 3 1 5
Table 4. Complexity analysis of related work.
Table 4. Complexity analysis of related work.
LSICKTDGKGC
Computation 3 2 + 384 23 + 11 , 776 ( 120 + 7 2 ) · + 3 2 · log 2 ( + 2 ) 200 ·
Re-randomization 5 · - 480 · -
Communication 3072 · 2048 2048 · 1520 ·
Rounds111
Storage51202048 3072 · 1520 ·
Security for Aperfectweakperfectcomp.
Security for Bcomp.comp.comp.comp.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Veugen, T. Lightweight Secure Integer Comparison. Mathematics 2022, 10, 305. https://doi.org/10.3390/math10030305

AMA Style

Veugen T. Lightweight Secure Integer Comparison. Mathematics. 2022; 10(3):305. https://doi.org/10.3390/math10030305

Chicago/Turabian Style

Veugen, Thijs. 2022. "Lightweight Secure Integer Comparison" Mathematics 10, no. 3: 305. https://doi.org/10.3390/math10030305

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop