Pierre Dellenbach

Aurélien Bellet

Jan Ramon

Hiding in the Crowd: A Massively Distributed Algorithm for Private Averaging with Malicious Adversaries

The amount of personal data collected in our everyday interactions with connected devices offers great opportunities for innovative services fueled by machine learning, as well as raises serious concerns for the privacy of individuals. In this paper, we propose a massively distributed protocol for a large set of users to privately compute averages over their joint data, which can then be used to learn predictive models. Our protocol can find a solution of arbitrary accuracy, does not rely on a third party and preserves the privacy of users throughout the execution in both the honest-but-curious and malicious adversary models. Specifically, we prove that the information observed by the adversary (the set of maliciours users) does not significantly reduce the uncertainty in its prediction of private values compared to its prior belief. The level of privacy protection depends on a quantity related to the Laplacian matrix of the network graph and generally improves with the size of the graph. Furthermore, we design a verification procedure which offers protection against malicious users joining the service with the goal of manipulating the outcome of the algorithm.

Introduction

Through browsing the web, engaging in online social networks and interacting with connected devices, we are producing ever growing amounts of sensitive personal data. This has fueled the massive development of innovative personalized services which extract value from users' data using machine learning techniques. In today's dominant approach, users hand over their personal data to the service provider, who stores everything on centralized or tightly coupled systems hosted in data centers. Unfortunately, this poses important risks regarding the privacy of users. To mitigate these risks, some approaches have been proposed to learn from datasets owned by several parties who do not want to disclose their data. However, they typically suffer from some drawbacks: (partially) homomorphic encryption schemes [START_REF] Paillier | Public-key cryptosystems based on composite degree residuosity classes[END_REF][START_REF] Graepel | ML Confidential: Machine Learning on Encrypted Data[END_REF]Aslett et al., 2015) require the existence of a trusted third party, secure multi-party computation techniques [START_REF] Yao | Protocols for secure computations[END_REF][START_REF] Lindell | Secure Multiparty Computation for Privacy-Preserving Data Mining[END_REF] are generally intractable when the number of parties is large, and exchanging noisy sketches of the data through (local) differential privacy [START_REF] Dwork | Differential Privacy[END_REF][START_REF] Duchi | Privacy Aware Learning[END_REF] only provides approximate solutions which are quite inaccurate in the highly distributed setting considered here. Furthermore, many of these techniques are not robust to the presence of malicious parties who may try to manipulate the outcome of the algorithm.

In this paper, our goal is to design a massively distributed protocol to collaboratively compute averages over the data of thousands to millions of users (some of them honest-but-curious and some corrupted by a malicious party), with arbitrary accuracy and in a way that preserves their privacy. For machine learning algorithms whose sufficient statistics are averages (e.g., kernel-based algorithms in primal space and decision trees), this could be used as a primitive to privately learn more complex models. The approach we propose is fully decentralized: users keep their own data locally and exchange information asynchronously over a peer-to-peer network (represented as a connected graph), without relying on any third party. Our algorithm (called Gopa: GOssip for Private Averaging) draws inspiration from a randomized gossip protocol for averaging [START_REF] Boyd | Randomized Gossip Algorithms[END_REF], augmented with a first phase involving pairwise exchanges of noise terms so as to mask the private values of users without affecting the global average. We first analyze the correctness of the algorithm, showing that the addition of noise has a mild effect on the convergence rate. We then study the privacy guarantees of Gopa in a Bayesian framework, where the adversary has some prior belief about the private values. Specifically, we give an exact expression for the posterior variance of the adversary after he has observed all the information output by the protocol, and show that the variance loss is negligible compared to the prior. This is equivalent to showing that the uncertainty in the adversary's predictions of the private values has not been significantly reduced. Interestingly, the proportion of preserved variance depends on the variance of the noise used to mask the values but also on an interpretable quantity related to the Laplacian matrix of the network graph. To the best of our knowledge, we are the first to draw a link between privacy and a graph smoothing operator popular in semi-supervised learning [START_REF] Zhu | Learning from labeled and unlabeled data with label propagation[END_REF][START_REF] Zhou | Learning with Local and Global Consistency[END_REF], multi-task learning [START_REF] Evgeniou | Regularized multi-task learning[END_REF] and signal processing [START_REF] Shuman | The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains[END_REF]. We show how this result motivates the use of a random graph model to construct the network graph so as to guarantee strong privacy even under rather large proportions of malicious users, as long as the number of users is big enough. The practical behavior of Gopa is illustrated on some numerical simulations. Finally, we further enhance our protocol with a verification procedure where users are asked to publish some values in encrypted form, so that cheaters trying to manipulate the output of the algorithm can be detected with high probability while preserving the aforementioned privacy guarantees.

The rest of this paper is organized as follows. Section 2 describes the problem setting, including our adversary and privacy models. Section 3 presents some background on (private) decentralized averaging and partially homomorphic encryption, along with related work and baseline approaches. Section 4 introduces the Gopa algorithm and studies its convergence qs well as privacy guarantees. Section 5 describes our verification procedure to detect cheaters. Finally, Section 6 displays some numerical simulations. Proofs can be found in the supplementary material.

Preliminaries

We consider a set U = {1, . . . , n} of n ≥ 3 users. Each user u ∈ U holds a personal value X u ∈ R, which can be thought of as the output of some function applied to the personal data of u (e.g., a feature vector describing u). The users want to collaboratively compute the average value X avg = 1 n n u=1 X u while keeping their personal value private. Such a protocol could serve as a building block for privately running machine learning algorithms which interact with the data only through averages, such as linear regression models (ordinary least-squares, ridge regression), decision trees and gradient descent for empirical risk minimization problems. We denote by X the vector

X = [X 1 , . . . , X n ] ∈ R n .
Instead of relying on a central server or any third party to exchange information, users communicate over a peer-to-peer network represented by a connected undirected graph G = (U, E), where (u, v) ∈ E indicates that users u and v are neighbors in G and can exchange messages directly. For a given user u, we denote by N (u) = {v : (u, v) ∈ E} the set of its neighbors. We denote by A the adjacency matrix of G, by d = (d 1 , . . . , d n ) the degree vector (d u = v A uv ) and by L = diag(d) -A its Laplacian matrix.

Adversary Models

We consider two commonly adopted adversary models for users, which were formalized by [START_REF] Goldreich | Secure multi-party computation[END_REF] and are used in the design of many secure protocols. An honest-but-curious (honest for short) user will follow the protocol specification, but can use all the information received during the execution to infer information about other users. In contrast, a malicious user may deviate from the protocol execution by sending incorrect values at any point (but we assume that they follow the required communication policy; if not, this can be easily detected). Malicious users can collude, and thus will be seen as a single malicious party who has access to all information collected by malicious users. We only restrict the power of attackers by requiring that honest users communicate through secure channels, which means that malicious users only observe information during communications they take part in.

Each user in the network is either honest or malicious, and honest users do not know whether other nodes are honest or malicious. We denote by U H ⊆ U the set of honest users and by f = 1 -|U H |/n the proportion of malicious users in the network. We also denote by

G H = (U H , E H ) the subgraph of G induced by U H , so that E H = {(u, v) ∈ E : u, v ∈ U H }.
Throughout the paper, we will rely on the following natural assumption on G H (we will discuss how to generate G such that it holds in practice in Section 4.4).

Assumption 1. The graph of honest users G H is connected.

This implies that there exists a path between any two honest users in the full graph G which does not go through a malicious node. In the rest of the paper, we will use the term adversary to refer to the set of malicious users (privacy with respect to a honest user can be obtained as a special case).

Privacy Model

Recall that our goal is to design a protocol which deterministically outputs the exact average (which we argue does not reveal much information about individual values in the large-scale setting we consider). This requirement automatically rules out Differential Privacy [START_REF] Dwork | Differential Privacy[END_REF] as the latter implies that the output of the protocol has to be randomized.

We take a Bayesian, semantic view of privacy promoted by several recent papers [START_REF] Kasiviswanathan | On the 'Semantics' of Differential Privacy: A Bayesian Formulation[END_REF][START_REF] Li | Membership privacy: a unifying framework for privacy definitions[END_REF]Kifer and Machanavajjhala, 2014;[START_REF] He | Blowfish privacy: tuning privacy-utility trade-offs using policies[END_REF]. We consider a family of prior distributions which represent the potential background knowledge that the adversary may have about the private values of honest users (since the adversary controls the malicious users, we consider he has exact knowledge of their values). We will denote by P (X u ) the prior belief of the adversary about the private value of some honest user u ∈ U H . Given all the information I gathered by the adversary during the execution of the protocol, the privacy notion we consider is that the ratio of prior and posterior variance of the private value X u is lower bounded by 1 -for some ∈ [0, 1]:

var(X u | I) var(X u ) ≥ 1 - (1)
The case = 1 describes the extreme case where observing I removed all uncertainty about X u . On the other hand, when = 0, all variance was preserved.

It is important to note that (1) with close to 0 does not guarantee that the adversary learns almost nothing from the output I: in particular, the posterior expectation E[X u | I] can largely differ from the prior expectation E[X u ], especially if the observed global average was very unlikely under the prior belief. This is related to the "no free lunch" theorem in data privacy (Kifer and Machanavajjhala, 2011), see also the discussions in [START_REF] Kasiviswanathan | On the 'Semantics' of Differential Privacy: A Bayesian Formulation[END_REF]; [START_REF] Li | Membership privacy: a unifying framework for privacy definitions[END_REF]. What (1) does guarantee, however, is that the squared error that the adversary expects to make by predicting the value of some private X u after observing I is almost the same as it was before observing I. In other words, the uncertainty in its prediction has not been significantly reduced by the participation to the protocol. This is formalized by the following remark.

Remark 1 (Expected squared error). Assume that (1) is satisfied. Let Y u = E[X u ] be the best prediction (in terms of expected square error) that the adversary can make given its prior belief. After observing the output I, the adversary can make a new best guess

Y I u = E[X u | I]. We have: E[(Y I u -X u ) 2 ] E[(Y u -X u ) 2 ] = var(X u | I) var(X u ) = 1 -.
Our results will be valid for Gaussian prior distributions of the form X u ∼ N (0, σ 2 X ), for all σ 2 X > 0. 1 We assume for simplicity that the prior variance is the same for all u, but our analysis straightforwardly extends Algorithm 1 Randomized gossip [START_REF] Boyd | Randomized Gossip Algorithms[END_REF] 1:

Input: graph G = (U, E), initial values (X u (0)) u∈U 2: for t ∈ {1, 2, ...} do 3: Draw (u, v) uniformly at random from E 4: Set X u (t), X v (t) ← 1 2 (X u (t -1) + X v (t -1)) 5: end for
to the more general case where X u ∼ N (0, σ 2 Xu ). We use centered Gaussians without loss of generality, since (1) depends only on the variance.

Remark 2 (Privacy axioms). One can show that our notion of privacy (1) satisfies the axioms that any reliable privacy definition should satisfy according to [START_REF] Kifer | An Axiomatic View of Statistical Privacy and Utility[END_REF], namely "transformation invariance" and "convexity".

3 Background and Related Work

Decentralized Averaging

The problem of computing the average value X avg of a set of users in a fully decentralized network without a central coordinator has been extensively studied (see for instance [START_REF] Tsitsiklis | Problems in decentralized decision making and computation[END_REF][START_REF] Kempe | Gossip-Based Computation of Aggregate Information[END_REF][START_REF] Boyd | Randomized Gossip Algorithms[END_REF]. In most existing approaches, users iteratively compute the weighted average between their value and those of (a subset of) their neighbors in the network. We focus here on the randomized gossip algorithm proposed by [START_REF] Boyd | Randomized Gossip Algorithms[END_REF] as it is simple, asynchronous and exhibits fast convergence. Each user has a clock ticking at the times of a rate 1 Poisson process. When the clock of an user u ticks, it chooses a random neighbor v and they average their current value. As discussed in [START_REF] Boyd | Randomized Gossip Algorithms[END_REF], one can equivalently consider a single clock ticking at the times of a rate n Poisson process and a random edge (u, v) ∈ E drawn at each iteration. The procedure is shown in Algorithm 1, and one can show that all users converge to X avg at a geometric rate.

Although there is no central server collecting all users' data, the above gossip algorithm is not private since users must share their inputs directly with others. A way to ensure privacy is that each user locally perturbs its own input before starting the algorithm so as to satisfy local differential privacy [START_REF] Duchi | Privacy Aware Learning[END_REF][START_REF] Kairouz | Extremal Mechanisms for Local Differential Privacy[END_REF].

Baseline 1. Assume |X u | ≤ B X for some finite B X ∈ R. Each user u computes a perturbed value X u = X u + η u , where η u is a noise value with Laplacian distribution P (η u ) = exp(-|η u |/b)/2b with b = 2B/ .
This guarantees that X = [ X 1 , . . . , X n ] T is an -differentially private approximation of X (see e.g., [START_REF] Dwork | Differential Privacy: A Survey of Results[END_REF], hence running Algorithm 1 on X is also -differentially private.

Unfortunately, this protocol converges to an approximate average Xavg = n u=1 (X u + η u )/n, and the associated RMSE E[(X avg -Xavg ) 2 ] = b 2/n can be high even for a large number of users. For instance, for n = 10 4 users, = 0.1 and B = 0.5, the RMSE is approximately 0.14.

Other attempts have been made at designing privacy-preserving decentralized averaging protocols under various privacy and attack models, and additional assumptions on the network topology. For an adversary able to observe all communications in the network, [START_REF] Huang | Differentially private iterative synchronous consensus[END_REF] proposed an -differentially private protocol where users add exponentially decaying Laplacian noise to their value. The protocol converges with probability p to a solution with an error radius of order O(1/ (1 -p)n). [START_REF] Manitara | Privacy-preserving asymptotic average consensus[END_REF] instead proposed that each user iteratively adds a finite sequence of noise terms which sum to zero, so that convergence to the exact average can be achieved. The adversary consists of a set of curious nodes which follow the protocol but can share information between themselves. Under some assumption on the position of the curious nodes in the network, their results prevent perfect recovery of private values but do not bound the estimation accuracy that the adversary can achieve. [START_REF] Mo | Privacy preserving average consensus[END_REF] proposed to add and subtract exponentially decaying Gaussian noise, also ensuring convergence to the exact average. They consider only honest-but-curious nodes and rely on a strong topological assumption, namely that there is no node whose neighborhood includes another node and its entire neighborhood. Their privacy guarantees are in the form of lower bounds on the covariance matrix of the maximum likelihood estimate of the private inputs that any node can make, which are difficult to interpret and very loose in practice. Finally, [START_REF] Hanzely | Privacy Preserving Randomized Gossip Algorithms[END_REF] introduced variants of Algorithm 1 which intuitively leak less information about the private inputs, but do not necessarily converge to the exact average. Importantly, they do prove any formal privacy guarantee.

In the above approaches, privacy is typically achieved by asking each user to independently add decaying local noise to its private value, which results in accuracy loss and/or weak privacy guarantees. In contrast, the protocol we propose in this paper relies on sharing zero-sum noise terms across users so as to "dilute" the knowledge of private values into the crowd. This will allow a flexible trade-off between privacy and convergence rate even when a node has a large proportion of malicious neighbors, while ensuring the convergence to the exact average. Furthermore and unlike all the above approaches, we provide a verification procedure to prevent malicious nodes from manipulating the output of the algorithm. This verification procedure relies on partially homomorphic encryption, which we briefly present below.

Partially Homomorphic Encryption

A standard technique for secure computation is to rely on a partially homomorphic encryption scheme to cipher the values while allowing certain operations to be carried out directly on the cypher text (without decrypting).

We use the popular Paillier cryptosystem [START_REF] Paillier | Public-key cryptosystems based on composite degree residuosity classes[END_REF], which is additive. Formally, one generates a public (encryption) key K pub = (N, g), where N = pq for p = q two independent large primes and g ∈ Z *

N 2 , and a secret (decryption) key

K priv = lcm(p -1, q -1). A message m ∈ Z * N can then be encrypted into a cypher text with ε(m) = g m • r N mod N 2 , ( 2
)
where r is drawn randomly from Z * N . With knowledge of the secret key, one can recover m from ε(m) based on the fact that ε(m) λ -1 g λ -1 ≡ m mod N . Denote the decryption operation by ε -1 . Paillier satisfy the following homomorphic property for any m 1 , m 2 ∈ Z * N :

ε -1 (ε(m 1 ) • ε(m 2 ) mod N 2 ) = m 1 + m 2 mod N, (3) hence ε(m 1 ) • ε(m 2 ) is a valid encryption of m 1 + m 2 .
For the purpose of this paper, we will consider the Paillier encryption scheme as perfectly secure (i.e., the computational complexity needed to break the encryption is beyond reach of any party). We can use the Paillier scheme to design a second simple baseline for private averaging.

Baseline 2. Consider X 1 , . . . , X n ∈ Z * N and assume that users trust two central honest-but-curious entities: the server and the third party. The server generates a Paillier encryption scheme (K pub , K priv ) and broadcasts K pub to the set of users. Each user u computes ε(X u ) and sends it to the third party. Following (3), the third party then computes n u=1 ε(X u ) and sends it to the server, which can obtain X avg by decrypting the message (and dividing by n).

If the server and the third party are indeed honest, nobody observes any useful information except the outcome X avg . But if they are not honest, various breaches can occur. For instance, if the third party is malicious, it can send an incorrect output to the server. The third party could also send the encrypted values of some users to the server, which can decrypt them using the private key K priv . Similarly, if the server is malicious, it can send K priv to the third party which can then decrypt all of the users' private values.

In contrast, we will design a protocol which eliminates the need for such central trusted entities and instead distributes the trust across many users in the network (Section 4). We will however rely on homomorphic encryption to detect potential malicious users (Section 5).

Algorithm 2 Randomization phase of Gopa

1: Input: graph G = (U, E), private values (X u ) u∈U , distribution µ : R → [0, 1] 2: for all neighbor pairs (u, v) ∈ E s.t. u < v do 3:
u and v jointly draw a random number δ ∈ R from µ 4: δ u,v ← δ, δ v,u ← -δ 5: end for 6: for all users u ∈ U do 7:

∆ u ← v∈N (u) δ u,v , X u ← X u + ∆ u 8:
end for 9: Output: noisy values ( X u ) u∈U 4 GOPA: Private Gossip Averaging Protocol

Protocol Description

We describe our Gopa protocol (GOssip for Private Averaging), which works in two phases. In the first phase (randomization phase), users mask their private value by adding noise terms that are correlated with their neighbors, so that the global average remains unchanged. In the second phase (averaging phase), users average their noisy values. For simplicity of explanation, we abstract away the communication mechanisms, i.e., contacting a neighbor and exchanging noise are considered as atomic operations.

Randomization phase. Algorithm 2 describes the first phase of Gopa, during which all neighboring nodes (u, v) ∈ E contact each other to exchange noise values. Specifically, they jointly draw a random real number δ from a probability distribution µ (a parameter of the algorithm that the community agrees on), that u will add to its private value and v will subtract. Following the common saying "don't put all your eggs in one basket", each user thereby distributes the noise masking his private value across several other users (his direct neighbors but also beyond by transitivity), which will provide some robustness to malicious parties. The idea is reminiscent of one-time pads (see for instance [START_REF] Bonawitz | Practical Secure Aggregation for Privacy-Preserving Machine Learning[END_REF], Section 3 therein), but our subsequent analysis will highlight the key role of the network topology and show that we can tune the magnitude of the noise so as to trade-off between privacy on the one hand, and convergence speed as well as the impact of user drop out on the other hand. The result of this randomization phase is a set of noisy values X = [ X 1 , . . . , X n ] for each user, with the same average value X avg as the private values. Note that each user u exchanges noise exactly once with each of his neighbors, hence the noisy value X u consists of d u noise terms.

Averaging phase. In the second phase, the users start from their noisy values X obtained in the randomization phase and simply run the standard randomized gossip averaging algorithm (Algorithm 1).

Correctness and Convergence of Gopa

In this section, we study the correctness and convergence rate of Gopa. Let X(t) = [ X 1 (t), . . . , X n (t)] be the values after t ≥ 0 iterations of the averaging phase (Algorithm 1) initialized with the noisy values X generated by the randomization phrase (Algorithm 2). Following the seminal work of [START_REF] Boyd | Randomized Gossip Algorithms[END_REF], we will measure the convergence rate in terms of the τ -averaging time. Given τ ∈ (0, 1), the τ -averaging time is the number of iterations t(τ ) needed to guarantee that for any t ≥ t(τ ):

Pr( X(t) -X avg 1 / X ≥ τ ) ≤ τ.
(4)

Note that the error in (4) is taken relatively to the original set of values X to account for the impact of the addition of noise on the convergence rate. We have the following result for the case where all users are honest (we will lift this requirement in Section 5).

Proposition 1 (Correctness and convergence rate). When all users are honest, the sequence of iterates ( X(t)) t≥0 generated by Gopa satisfies lim t→+∞ E[ X(t)] = X avg 1. Furthermore, the τ -averaging time of Algorithm 1 is:

t(τ ) = 3 log 2B δ (d max + 3) τ B X log(1/C G ), (5)
where C G = 1 -λ 2 (L)/|E| ∈ (0, 1) with λ 2 (L) the second smallest eigenvalue of the Laplacian matrix L [START_REF] Boyd | Randomized Gossip Algorithms[END_REF][START_REF] Colin | Extending Gossip Algorithms to Distributed Estimation of U-statistics[END_REF], d max = max u d u is the maximum degree and B X , B δ are upper bounds for the absolute value of private values and noise terms respectively.2

Proposition 1 allows to quantify the worst-case impact of the randomization phase on the convergence of the averaging phase. The τ -averaging time of Gopa is only increased by a constant additive factor compared to the non-private averaging phase. Importantly, this additive factor has a mild (logarithmic) dependence on B and d max . This behavior will be confirmed by numerical experiments in Section 6.

Privacy Guarantees

We now study the privacy guarantees of Gopa. We consider that the knowledge I acquired by the adversary (colluding malicious users) during the execution of the protocol contains the following: (i) the noisy values X of all users at the end of the randomization phase, (ii) the full network graph (and hence which pairs of honest users exchanged noise), and (iii) for any communication involving a malicious party, the noise value used during this communication. The only unknowns are the private values of honest users, and noise values exchanged between them. Note that (i) implies that the adversary learns the network average.

Remark 3. Since we assume that the noisy values X = [ X 1 , . . . , X n ] are known to the adversary, our privacy guarantees will hold even if these values are publicly released. Note however that computing the average with Algorithm 1 provides additional protection as the adversary will observe only a subset of the noisy values of honest nodes (those who communicate with a malicious user at their first iteration). In fact, inferring whether a received communication is the first made by that user is already challenging due to the asynchronous nature of the algorithm.

Our main result exactly quantifies how much variance is left in any private value X u after the adversary has observed all information in I.

Theorem 1 (Privacy guarantees). Assume that the prior belief on the private values X 1 , . . . , X n is Gaussian, namely X u ∼ N (0, σ 2 X ) for all honest users u ∈ U H , and that the noise variables are also drawn from a Gaussian distribution µ = N (0, σ 2 δ ). Denote by e u ∈ R n the indicator vector of the u-th coordinate and let

M = (I + σ 2 δ σ 2 X L H ) -1 ∈ R n×n ,
where L H is the Laplacian matrix of the graph G H . Then we have for all

honest user u H ∈ U : var(X u | I) var(X u ) = 1 -e u M e u . ( 6
)
We now provide an detailed interpretation of the above result. First note that the proportion of preserved variance only depends on the interactions between honest users, making the guarantees robust to any adversarial values that malicious users may send. Furthermore, notice that matrix M can be seen as a smoothing operator over the graph G H . Indeed, given some y ∈ R n , M y ∈ R n is the solution to the following optimization problem:

min s∈R n s -y 2 2 + αs L H s, (7)
where α = σ 2 δ /σ 2 X ≥ 0. This problem is known as graph smoothing (also graph regularization, or graph filtering) and has been used in the context of semi-supervised learning (see [START_REF] Zhu | Learning from labeled and unlabeled data with label propagation[END_REF][START_REF] Zhou | Learning with Local and Global Consistency[END_REF], multi-task learning [START_REF] Evgeniou | Regularized multi-task learning[END_REF] and signal processing on graphs [START_REF] Shuman | The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains[END_REF], among others. The first term in (7) encourages solutions that are close to y while the second term is the Laplacian quadratic form s L H s = (u,v)∈E H (s u -s v ) 2 which enforces solutions that are smooth over the graph (the larger α, the more smoothing). One can show that M is a doubly stochastic matrix [START_REF] Segarra | Diffusion and Superposition Distances for Signals Supported on Networks[END_REF], hence the vector M y sums to the same quantity as the original vector y. In our context, we smooth the indicator vector e u so e u M e u ∈ [0, 1]: the larger the noise variance σ 2 δ and the more densely connected the graph of honest neighbors, the more "mass" is propagated from user u to other nodes, hence the closer to 0 the value e u M e u and in turn the more variance of the private value X u is preserved. Note that we recover the expected behavior in the two extreme cases: when σ 2 δ = 0 we have e u M e u = 1 and hence the variance ratio is 0, while when σ 2 δ → ∞ we have e u M e u → 1/|U H | and hence var(X u | I)/var(X u ) = 1 -1/|U H |. This irreducible variance loss accounts for the fact that the adversary learns from I the average over the set of honest users (by adding their noisy values and subtracting the noise terms he knows). Since we assume the number of users to be very large, this variance loss can be considered negligible. We emphasize that in contrast to the lower bounds on the variance of the maximum likelihood estimate obtained by [START_REF] Mo | Privacy preserving average consensus[END_REF], our variance computation ( 6) is exact, interpretable and holds under non-uniform prior beliefs of the adversary.

It is important to note that smoothing occurs over the entire graph G H : by transitivity, all honest users in the network contribute to keeping the private values safe. In other words, Gopa turns the massively distributed setting into an advantage for privacy, as we illustrate numerically in Section 6. Note, still, that one can derive a simple (but often loose) lower bound on the preserved variance which depends only on the local neighborhood.

Proposition 2. Let u ∈ U H and denote by |N H (u)| the number of honest neighbors of u. We have:

var(X u | I) ≥ σ 2 X • σ 2 δ ( N H (u) + 1) σ 2 X + σ 2 δ (|N H (u)| + 1) • N H (u) |N H (u) + 1|
.

Proposition 2 shows that the more honest neighbors, the larger the preserved variance. In particular, if

σ 2 δ > 0, we have var(X u | I) → σ 2 X as |N H (u)| → ∞.
We conclude this subsection with some remarks.

Remark 4 (Composition). As can be seen from inspecting the proof of Theorem 1, P (X u | I) is a Gaussian distribution. This makes our analysis applicable to the setting where Gopa is run several times with the same private value X u as input, for instance within an iterative machine learning algorithm. We can easily keep track of the preserved variance by recursively applying Theorem 1.

Remark 5 (G H not connected). The results above still hold when Assumption 1 is not satisfied. In this case, the smoothing occurs separately within each connected component of G H , and the irreducible variance loss is ruled by the size of the connected component of G H that the user belongs to (instead of the total number of honest users |U H |).

Remark 6 (Drop out). The use of centered Gaussian noise with bounded variance effectively limits the impact of some users dropping out during the randomization phase. In particular, any residual noise term has expected value 0, and can be bounded with high probability. Alternatively, one may ask each impacted user to remove the noise exchanged with users who have dropped (thereby ensuring exact convergence at the expense of reducing privacy guarantees).

Robust Strategies for Network Construction

We have seen above that the convergence rate and most importantly the privacy guarantees of GOPA crucially depend on the network topology. In particular, it is crucial that the network graph G = (U, E) is constructed in a robust manner to ensure good connectivity and to guarantee that all honest users have many honest neighbors with high probability. In the following, we assume users have an address list for the set of users and can select some of them as their neighbors. Note that the randomization phase can be conveniently executed when constructing the network.

Algorithm 3 Verification procedure for the randomization phase of Gopa 1: Input: each user u has generated its own Paillier encryption scheme and has published:

2:

• Public key K pub u , ε P u (X u ) (before the execution of Algorithm 2)

3:

• Noise values ε P u (δ u,v ) (when exchanging with v ∈ N (u) during Algorithm 2)

4:

• ε P u ( X u ), ε P u (∆ u ) (at the end of Algorithm 2) 5: for all user u ∈ U do 6:

ε ∆ ← v∈N (u) ε P u (δ u,v ), ε X ← ε P u (X u ) • ε P u (∆ u ) 7:
Verify that ε P u (∆ u ) = ε ∆ and ε P u ( X u ) = ε X (if not, add u to cheater list) 8: end for 9: for all user u ∈ U do 10:

Draw random subset V u of N (u) with |V u | = (1 -β)d u , ask u to publish δ u,v and r δu,v for v ∈ V u 11: for all v ∈ V u do 12: Ask v to publish r δv,u , verify that ε P v (δ v,u ) = ε v (-δ u,v ) and ε P u (δ u,v ) = ε u (δ u,v ) (if not, add u, v to cheater list) 13:
end for 14: end for A simple choice of network topology is the complete graph, which is best in terms of privacy (since each honest user has all |U H | -1 other honest users as neighbors) and convergence rate (best connectivity). Yet this is not practical when n is very large: beyond the huge number of pairwise communications needed for the randomization phase, each user also needs to create and maintain n -1 secure connections, which is costly [START_REF] Chan | Random Key Predistribution Schemes for Sensor Networks[END_REF].

We propose instead a simple randomized procedure to construct a sparse network graph with the desired properties based on random k-out random graphs (Bollobás, 2001), also known as random k-orientable graphs [START_REF] Fenner | On the connectivity of random m-orientable graphs and digraphs[END_REF]. The idea is to make each (honest) user select k other users uniformly at random from the set of all users. Then, the edge (u, v) ∈ E is created if u selected v or v selected u (or both). This procedure is the basis of a popular key predistribution scheme used to create secure peer-to-peer communication channels in distributed sensor networks [START_REF] Chan | Random Key Predistribution Schemes for Sensor Networks[END_REF]. [START_REF] Fenner | On the connectivity of random m-orientable graphs and digraphs[END_REF] show that for any k ≥ 2, the probability that the graph is k-connected goes to 1 almost surely. This provides robustness against malicious users. Note also that the number of honest neighbors of a honest node follows a hypergeometric distribution and is tightly concentrated around its expected value k(1 -f ), where f is the proportion of malicious users. It is worth noting that the probability that the graph is connected is actually very close to 1 even for small n and k. This is highlighted by the results of [START_REF] Yağan | On the Connectivity of Sensor Networks Under Random Pairwise Key Predistribution[END_REF], who established a rather tight lower bound on the probability of connectivity of random k-out network graphs. For instance, the probability is guaranteed to be larger than 0.999 for k = 2 and n = 50. The algebraic connectivity λ 2 (L) is also large in practice for random k-out graphs, hence ensuring good convergence as per Proposition 1.

Verification Procedure

We have shown in Section 4.2 that Gopa converges to the appropriate average when users are assumed not to tamper with the protocol by sending incorrect values. In this section, we complement our algorithm with a verification procedure to detect malicious users who try to influence the output of the algorithm (we refer to them as cheaters). While it is impossible to force a user to give the "right" input to the algorithm (no one can force a person to answer honestly to a survey), 3 our goal is to make sure that given the input vector X, the protocol will either output X avg or detect cheaters with high probability. Our approach is based on asking users to publish some (potentially encrypted) values during the execution of the protocol. 4The published information should be publicly accessible so that anyone may verify the validity of the protocol (avoiding the need for a trusted verification entity), but should not threatens the privacy.

In order to allow public verification without compromising privacy, we will rely on the Paillier encryption scheme described in Section 3.2. For the purpose of this section, we assume that all quantities (private values and noise terms) are in Z N . This is not a strong restriction since with appropriate N and scaling one can represent real numbers from a given interval with any desired finite precision. Each user u generates its own Paillier scheme and publishes encrypted values using its encryption operation ε u (•). These published cypher texts may not be truthful (when posted by a malicious user), hence we denote them by the superscript P to distinguish them from a valid encryption of a value (e.g., ε P u (v) is the cypher text published by u for the quantity v).

Algorithm 3 describes our verification procedure for the randomization phase of Gopa (the averaging phase can be verified in a similar fashion). In a first step, we verify the coherence of the publications of each user u, namely that ∆ u = v∈N (u) δ u,v and X u = X u + ∆ u are satisfied for the published cypher texts of these quantities. To allow reliable equality checks between cipher texts, some extra care is needed (see supplementary material for details). The second step is to verify that during a noise exchange, the user and his neighbor have indeed used opposite values as noise terms. However, each user has his own encryption scheme so one cannot meaningfully compare cypher texts published by two different users. To address this issue, we ask each user u to publish in plain text a random selected fraction (1 -β) ∈ [0, 1] of his noise values (δ u,v ) v∈N (u) (the noise values to reveal are drawn publicly). The following result lower bounds the probability of catching a cheater.

Proposition 3 (Verification). Let C be the number of times a user cheated during the randomization phase. If we apply the verification procedure (Algorithm 3), then the probability that a cheater is detected is at least 1 -β 2C .

Proposition 3 shows that Algorithm 3 guards against large-scale cheating: the more cheating, the more likely at least one cheater gets caught. Small scale cheating is less likely to be detected but cannot affect much the final output of the algorithm (as values are bounded with high probability and the number of users is large). Of course, publishing a fraction of the noise values in plain text decreases the privacy guarantees: publishing δ u,v in plain text for u, v ∈ U H corresponds to ignoring the associated edge of G H in our privacy analysis. If the community agrees on β in advance, this effect can be easily compensated by constructing a network graph of larger degree, see Section 4.4.

Numerical Experiments

In this section, we run some simulations to illustrate the practical behavior of Gopa. In particular, we study two aspects: the impact of the noise variance on the convergence and on the proportion of preserved data variance, and the influence of network topology. In all experiments, the private values are drawn from the normal distribution N (0, 1), and the network is a random k-out graph (see Section 4.4).

Figure 1 illustrates the impact of the noise variance on the convergence of the averaging phase of Gopa, for n = 1000 users and k = 10. We see on Figure 1(a) that larger σ 2 δ have a mild effect on the convergence rate. Figure 1(b) confirms that the number of iterations t needed to reach a fixed error X(t) -X avg 1 / X is logarithmic in σ 2 δ , as shown by our analysis (Proposition 1). Figure 2 shows the proportion of preserved data variance for several topologies and proportions of malicious nodes in the network. Recall that in random k-out graphs with fixed k, the average degree of each user is roughly equal to 2k and hence remains constant with n. The results clearly illustrate one of our key result: beyond the noise variance and the number of honest neighbors, the total number of honest users has a strong influence on how much variance is preserved. The more users, the more smoothing on the graph and hence the more privacy, without any additional cost in terms of memory or computation for each individual user since the number of neighbors to interact with remains constant. This effect is even more striking when the proportion of malicious users is large, as in Figure 2(b). Remarkably, for n large enough, Gopa can effectively withstand attacks from many malicious users.

Conclusion

We proposed and analyzed a massively distributed protocol to privately compute averages over the values of many users, with robustness to malicious parties. Our novel privacy guarantees highlight the benefits of the large-scale setting, allowing users to effectively "hide in the crowd" by distributing the knowledge of their private value across many other parties. We believe this idea to be very promising and hope to extend its scope beyond the problem of averaging. In particular, we would like to study how our protocol may be used as a primitive to learn complex machine learning models in a privacy-preserving manner. Σ [δu,v,δu,v] = σ 2 δ . We know that var(V) = Σ. T V is a linear transformation of a multivariate Gaussian, and hence a multivariate Gaussian itself. In particular, it holds that var(T V) = T ΣT .

We now consider the random vector CV conditioned on AV = b. This again gives a Gaussian distribution, with Let u ∈ U H some honest user. We now focus on the variance of the private value X u conditioned on the information obtained by the adversary:

var(X u | AV = b) = var(e u V|AV = b) = e u C † -ΣA (AΣA ) -1 AΣ)C (C ) † e u = σ 2 X -e u σ 2 X A (AΣA ) -1 Aσ 2 X e u = σ 2 X -σ 4 X e u A (AΣA ) -1 Ae u = σ 2 X -σ 4 X e u I B H ( I B H Σ I B H ) -1 I B H e u = σ 2 X -σ 4 X e u I B H (σ 2 X I + σ 2 δ B H B H ) -1 I B H e u = σ 2 X -σ 4 X e u (σ 2 X I + σ 2 δ B H B H ) -1 e u = σ 2 X -σ 4 X e u (σ 2 X I + σ 2 δ L H ) -1 e u , (10)
where L H Laplacian matrix associated with G H . Finally, for clarity we rewrite σ 2 X -σ 4 X e u (σ 2 X I + σ 2 δ L H ) -1 e u = σ 2 X [1 -e u (I +

σ 2 δ σ 2 X L H ) -1 e u ].

Appendix C Proof of Proposition 2

To better understand Theorem 1, we investigate a fictional scenario where the only noise exchanged in the network is between the user of interest u and his neighbors. It is clear that the amount of variance preserved in this scenario gives a lower bound for the general case (where pairs of nodes not involving u also exchange noise). Indeed, noise exchanges involving a malicious user have no effect (they are subtracted away in the linear system (9)), while those between honest users can only increase the uncertainty for the adversary. Without loss of generality, assume u = 1. The Laplacian matrix L H in Theorem 1 (ignoring the nodes which did not exchange noise) is given by

L =        |N H (u)| -1 -1 . . .

δFigure 1 :

 1 Figure 1: Impact of the noise variance on the convergence of Gopa for a random k-out graph with n = 1000 and k = 10, with mean and standard deviation over 10 random runs.

Figure 2 :

 2 Figure 2: Preserved data variance (mean and standard deviation across users) w.r.t. noise variance for several random k-out topologies and two proportions of malicious nodes.

C

  are non-singular and orthogonal to each other, T is also non-singular. Let Σ be a diagonal matrix with∀u ∈ U H , Σ [Xu],[Xu] = σ 2 X and ∀(u, v) ∈ E H < ,

  var(CV|AV = b) = var(CV) -cov(CV, AV)(var(AV, AV)) -1 cov(AV, CV) = (CΣC ) -(CΣA )(AΣA ) -1 (AΣC ) = C(Σ -ΣA (AΣA ) -1 AΣ)C .

We use Gaussian distributions for technical reasons. We expect similar results to hold for other families of distributions which behave nicely under conditioning and linear transformations, such as the exponential family.

We use a bounded noise assumption for simplicity. The argument easily extends to boundedness with high probability.

We can use range proofs[START_REF] Camenisch | Efficient protocols for set membership and range proofs[END_REF] to check that each input value lies in an appropriate interval without revealing anything else about the value.

We assume that users cannot change their published values after publication. This could be enforced by relying on blockchain structures as in Bitcoin transactions[START_REF] Nakamoto | Bitcoin: A Peer-to-Peer Electronic Cash System[END_REF].

Acknowledgments This research was partially supported by grant ANR-16-CE23-0016-01 and by a grant from CPER Nord-Pas de Calais/FEDER DATA Advanced data science and technologies 2015-2020. The work was also partially supported by ERC-PoC SOM 713626.

SUPPLEMENTARY MATERIAL

Appendix A Proof of Proposition in the HBC v∈N (u) δ u,v = 0. Therefore, the sum of the user values over the network remains unchanged after the randomization phase:

The first claim then follows from the correctness of the averaging procedure of [START_REF] Boyd | Randomized Gossip Algorithms[END_REF] used for the averaging phase.

From [START_REF] Boyd | Randomized Gossip Algorithms[END_REF], we know that the τ -averaging time of the averaging phase applied to the original (non-noisy) values X is 3 log(1/τ )/ log(1/C G ). Hence, to achieve the same guarantee (4), we need to run the algorithm for at least

iterations. Due to the bound on the noise values and the amount of noise exchanges a user can make, we have for any u ∈ U :

and hence

We get the second claim by plugging this inequality into (8).

Appendix B Proof of Theorem 1

We first introduce some auxiliary notations. Let E H < = {(u, v) ∈ E H | u < u } be the ordered edges between honest users. Let V (X) = (X u ) u∈U H be the vector of the private values of all honest users and V (δ) = (δ u,v ) (u,v)∈E H < be the vector of all values exchanged by these users. Let

be the concatenation of these two vectors. We will index vectors and matrices with elements of V. To emphasize that we refer to the random variable rather than its value, we will use square brackets. For

We formalize the knowledge I of the adversary by a set of linear equations, specifying the constraints the elements of V must satisfy according to its knowledge:

where

is the noisy value of user X u minus the sum of all noise terms exchanged with malicious users.

Let A be the matrix representing the above set of linear equations, and b the vector representing the right hand side, so that we can write (9) as

The matrix A has full rank and can be written as

identity matrix and B H is the oriented incidence matrix of the graph G H (where the direction of edges is given by Let V be a unitary

We have

Indeed, we can easily verify that LV :,1 = (|N H (u)| + 1)V :,1 and LV :,2 = 0. For every vector V :,i with i ≥ 3, we can check that V 2 1,1 + V 2 1,2 = 1 and hence V 1,i = 0. It follows that for any j ≥ 2, L j,: V :,i = V j,i . We know that V :,i is orthogonal to V :,2 and hence

Therefore, all vectors orthogonal to V :,1 and V :,2 are eigenvectors with eigenvalue 1.

We can now rewrite the matrix inverse in (10) from the proof of Theorem 1 as:

We are interested in user u = 1 so we focus on the value

Plugging back in (10), we finally get:

Appendix D Details on Verification Procedure

D.1 Reliable Equality Checks

To allow reliable equality checks between cipher texts, some extra care is needed. For any u ∈ U and v ∈ N (u), let us denote by r δu,v , r ∆u , r Xu and r Xu the random integers generated (and kept private) by user u to respectively encrypt δ u,v , ∆ u following relation (to simplify notations we assume that N (u) = {1, . . . , d u }):

It is easy to see that the equality checks can then be reliably performed. Crucially, the r δ u,k 's are random so some new randomness is added at each iteration of the above recursion, guaranteeing that the encrypted values of the noise terms and the noise sum ∆ u are perfectly secure. Note on the other hand that the encryption of the noisy value X u may not be perfectly secure, which is not a concern as our privacy guarantees of Section 4.3 hold under the knowledge of X u .

D.2 Proof Sketch of Proposition 3

We can assume that users published all the required values (this can be easily verified). The first part of Algorithm 3 verifies the coherence of the publications, namely that for all u, X u = X u + v∈N (u) δ u,v is satisfied for the published encrypted version of these quantities. If the coherence test passes, then the only way for two malicious users u and v to influence the final average is by adding noise terms such that δ u,v = -δ v,u .

Assume u and v indeed cheated. The probability that neither u or v is forced to publish the corresponding noise value is β 2 . Assume either one of them, say u, is forced to publish his value δ u,v in plain text. We can use it to check whether the cypher texts published by both u and v are indeed encrypted versions of δ u,v and -δ u,v respectively. If the verification fails, then one of them (or both) cheated. Otherwise, this noise exchange did not affect the average. We have shown that each time a user cheats, this is detected with probability at least 1 -β 2 . Then if C is the number of times that some user cheated, the probability of not catching any cheater is β 2C , and the result follows.