Secure Salary Averaging: Private Numbers, Public Mean
Eight quantitative analysts want to know the average of their salaries, but with a strict condition:
No one is willing to reveal their individual salary to anyone else.
How can they collaboratively compute the average while keeping each person’s salary strictly private?
The Goal
Let each person \( Q_1, Q_2, \ldots, Q_8 \) have a private salary \( s_1, s_2, \ldots, s_8 \).
They want to compute:
\[ \text{Average} = \frac{s_1 + s_2 + \cdots + s_8}{8} \]
without revealing any \( s_i \).
The Protocol: Secure Sum via Random Offsets
This method uses secure masking with random numbers.
Step-by-Step:
-
Q1 picks a very large random number \( r \) and adds it to their salary: \[ T_1 = s_1 + r \]
-
Q1 sends \( T_1 \) to Q2.
-
Each subsequent analyst \( Q_i \) (for \( i = 2 \) to \( 8 \)):
-
Adds their own salary \( s_i \) to the total they received: \[ T_i = T_{i-1} + s_i \]
-
Then passes \( T_i \) to the next person.
-
-
Q8 returns the final sum \( T_8 \) to Q1.
-
Q1 subtracts their random number \( r \): \[ \text{Total Sum} = T_8 - r = s_1 + s_2 + \cdots + s_8 \]
-
The group divides by 8 to compute the average salary.
Why It Works
- Only Q1 knows the random \( r \), which acts as a secure mask protecting the entire chain of partial sums.
- Every participant only sees a meaningless, masked running total.
- No one learns any individual salary (as long as participants don’t conspire).
- Only the total sum is ever revealed (to Q1), and then the average is shared.
Bonus Insight: The Collusion Flaw
In a quant interview, you are often asked a follow-up: “What’s the vulnerability here?”
The answer is collusion. If Q1 and Q3 secretly talk, they can compare the number Q1 sent (\(T_1\)) and the number Q3 received (\(T_2\)). Since \(T_2 - T_1 = s_2\), they instantly expose Q2’s private salary!
To fix this, a more robust protocol (like Secret Sharing) requires everyone to split their salary into 8 random fragments and distribute them, removing any single point of failure.
Final Answer
Yes, the quant team can compute the average securely.
Use a chained sum protocol with a random offset to mask individual values—revealing only the final average.