Eww
Eww
after this, i was wondering if there is a way to get the average salary of a group without revealing / knowing actual numbers ?
edit-001: ok, one thing that i can think of:
1. take a big number, and add your salary to it. this becomes the 'token' for the next guy.
2. he adds his salary to the number. etc. etc.
once you have the final number, remove the original number, and divide by number of folks. since this scheme appears to be so trivial, i am now wondering what i did wrong ?
Because the people at positions N and N+2 in your scheme can collude to determine the salary of the person at position N+1 without even having to reveal their own salaries in the process...
umm, not really trying to prevent from folks actively sabotage the whole thing, but just seeing if it actually works i.e gives the correct average salary...
but yes, as you have pointed out, people at N and N+2 can collude to get the original salary (for N+1).
Edit: I guess it doesn't even have to be a third party as long as everyone trusts the randomization (e.g., pulling identical pieces of folded paper from a hat).
If you really want a cryptographic secure process, the key word to begin your journey would be "secure multiparty computation", and a very appropriate example in the book modern cryptography[1]:
[1] https://cs.stanford.edu/people/eroberts/courses/soco/project...
Basically your first solution but encrypt the communication between parties to prevent the n+1 - n attack.
edit - Only say infinite8s reply now, which is almost verbatim my reply including the same link.
oooh :) this is pretty cool. thank you !
In many jurisdictions, this is illegal.