Daniel Pöllmann

Deciding Movie-Night Order (Passive Security)

Every Wednesday some friends and I have a movie-night for which one person always chooses the movie (read as: forces the others to watch). For reasons unknown to me, we don’t do it in Round-Robin style but choose the ordering randomly after everyone has had their turn.

Since the great pandemic of 2019, the movie night had to be done online - however, this meant that we ran into the problem of determining a fair, totally random order. If someone chooses an ordering using random.org the others cannot be sure that they did not cheat. Even with sharing their computer screen, we would not know. Maybe it’s just an elaborate screen recording… Maybe they changed the HTML… Maybe they are running a MITM attack on their network to intercept and change the HTTP responses… Maybe they got an internship at random.org and managed to bias their randomness generators… who knows…

For important applications such as choosing the movie-night order, we need proper information-theoretic assurances. (In the past we abused hash functions to construct commitment schemes)

Therefore, to determine the order fairly, we will construct a passively secure protocol to choose a random value:

There are 5 parties: P1=DP,P2=WD,P3=ToB,P4=TB,P5=FOP_1=DP, P_2=WD, P_3=ToB, P_4=TB, P_5=FO

Every party chooses a random value sPGF(120) s_P \in GF(120) and creates a random polynomial of degree at most 44 in GF(120)GF(120) such that their secret input sPs_P is at position 0:

fP(0)=sP f_{P}(0) = s_P

fP(x)=sP+c1x+c2x2+c3x3+c4x4 f_{P}(x) = s_P + c_1 \cdot x + c_2 \cdot x^2 + c_3 \cdot x^3 + c_4 \cdot x^4

Now we do a Shamir Secret Sharing Every party evaluates their polynomial f(x) f(x) at positions x1,2,3,4,5 x \in {1, 2, 3, 4, 5} and sends the evaluation to the corresponding party.

fP(1)DP f_{P}(1) \rightarrow DP

fP(2)WD f_{P}(2) \rightarrow WD

fP(3)ToB f_{P}(3) \rightarrow ToB

fP(4)TB f_{P}(4) \rightarrow TB

fP(5)FO f_{P}(5) \rightarrow FO

We want to calculate the polynomial f(x)=ΣiPfi(x) f(x) = \Sigma_{i \in P} f_i(x) and use f(0)f(0) as our random number which determines the order according to the table below.

Since Shamir Secret Sharing is linear in addition, everybody can add up their shares such that we obtain a sharing of the f(x) f(x) polynomial.

Now we reconstruct f(x) f(x) towards each party and everybody broadcasts their value.

For the reconstruction, everyone broadcasts their value and we interpolate the polynomial with Lagrange Interpolation (we omit the uniqueness proof): We have n points (α1,s1),(α2,s2),,(αn,sn) { (\alpha_1, s_1), (\alpha_2, s_2), …, (\alpha_n, s_n) } on some polynomial and we want to calculate this polynomial. We can certainly write it as:

f(x)=s+λ1(x)x1+λ2(x)x2++λt(x)xt f(x) = s + \lambda_1(x)\cdot x^1 + \lambda_2(x)\cdot x^2 + … + \lambda_t(x)\cdot x^t

where

if we can write the λi\lambda_i-Functions as a polynomial, then f(x)f(x) would certainly also be a polynomial.

Let’s construct the λi\lambda_i function:

λi(x)=Πj=1,jinxajaiaj\lambda_i(x) = \Pi_{j=1,j\neq i}^n \frac{x-a_j}{a_i-a_j}

We can easily see that this function has all the properties we want for λi\lambda_i.

Therefore, we can construct the whole polynomial based on our points as:

g(x)=Σi=1nλi(x)si g(x) = \Sigma_{i=1}^{n} \lambda_i(x)\cdot s_i

or for our case with n=5n=5:

g(x)=λ1(x)s1+λ2(x)s2+λ3(x)s3+λ4(x)s4+λ5(x)s5 g(x) = \lambda_1(x)\cdot s_1 + \lambda_2(x)\cdot s_2 + \lambda_3(x)\cdot s_3 + \lambda_4(x)\cdot s_4 + \lambda_5(x)\cdot s_5

=x212x313x414x515s1+x121x323x424x525s2+x131x232x434x535s3+x141x242x343x545s4+x151x252x353x454s5 =\frac{x-2}{1-2} \cdot \frac{x-3}{1-3} \cdot \frac{x-4}{1-4} \cdot \frac{x-5}{1-5} \cdot s_1 +\frac{x-1}{2-1} \cdot \frac{x-3}{2-3} \cdot \frac{x-4}{2-4} \cdot \frac{x-5}{2-5} \cdot s_2 +\frac{x-1}{3-1} \cdot \frac{x-2}{3-2} \cdot \frac{x-4}{3-4} \cdot \frac{x-5}{3-5} \cdot s_3 +\frac{x-1}{4-1} \cdot \frac{x-2}{4-2} \cdot \frac{x-3}{4-3} \cdot \frac{x-5}{4-5} \cdot s_4 +\frac{x-1}{5-1} \cdot \frac{x-2}{5-2} \cdot \frac{x-3}{5-3} \cdot \frac{x-4}{5-4} \cdot s_5

We calculate the result value as g(x=0)g(x=0).

Everybody now broadcasts their result value. If a party sees a value that is inconsistent, it broadcasts a complaint, and we restart the protocol. (This opens up the possibility that somebody claims that their value is inconsistent if they just don’t like the outcome. They can then DOS the protocol. We could remedy this by adding an information-theoretically secure distributed commitment scheme but that would be “too over-engineered” )

If a party sees consistent values from everyone, then they broadcast acceptance and we accept the value f(0)f(0) as our random value that determines the ordering.

Random Number Order
0 DP –> WD –> ToB –> TB –> FO
1 WD –> DP –> ToB –> TB –> FO
2 ToB –> DP –> WD –> TB –> FO
3 DP –> ToB –> WD –> TB –> FO
4 WD –> ToB –> DP –> TB –> FO
5 ToB –> WD –> DP –> TB –> FO
6 ToB –> WD –> TB –> DP –> FO
7 WD –> ToB –> TB –> DP –> FO
8 TB –> ToB –> WD –> DP –> FO
9 ToB –> TB –> WD –> DP –> FO
10 WD –> TB –> ToB –> DP –> FO
11 TB –> WD –> ToB –> DP –> FO
12 TB –> DP –> ToB –> WD –> FO
13 DP –> TB –> ToB –> WD –> FO
14 ToB –> TB –> DP –> WD –> FO
15 TB –> ToB –> DP –> WD –> FO
16 DP –> ToB –> TB –> WD –> FO
17 ToB –> DP –> TB –> WD –> FO
18 WD –> DP –> TB –> ToB –> FO
19 DP –> WD –> TB –> ToB –> FO
20 TB –> WD –> DP –> ToB –> FO
21 WD –> TB –> DP –> ToB –> FO
22 DP –> TB –> WD –> ToB –> FO
23 TB –> DP –> WD –> ToB –> FO
24 FO –> DP –> WD –> ToB –> TB
25 DP –> FO –> WD –> ToB –> TB
26 WD –> FO –> DP –> ToB –> TB
27 FO –> WD –> DP –> ToB –> TB
28 DP –> WD –> FO –> ToB –> TB
29 WD –> DP –> FO –> ToB –> TB
30 WD –> DP –> ToB –> FO –> TB
31 DP –> WD –> ToB –> FO –> TB
32 ToB –> WD –> DP –> FO –> TB
33 WD –> ToB –> DP –> FO –> TB
34 DP –> ToB –> WD –> FO –> TB
35 ToB –> DP –> WD –> FO –> TB
36 ToB –> FO –> WD –> DP –> TB
37 FO –> ToB –> WD –> DP –> TB
38 WD –> ToB –> FO –> DP –> TB
39 ToB –> WD –> FO –> DP –> TB
40 FO –> WD –> ToB –> DP –> TB
41 WD –> FO –> ToB –> DP –> TB
42 DP –> FO –> ToB –> WD –> TB
43 FO –> DP –> ToB –> WD –> TB
44 ToB –> DP –> FO –> WD –> TB
45 DP –> ToB –> FO –> WD –> TB
46 FO –> ToB –> DP –> WD –> TB
47 ToB –> FO –> DP –> WD –> TB
48 TB –> FO –> DP –> WD –> ToB
49 FO –> TB –> DP –> WD –> ToB
50 DP –> TB –> FO –> WD –> ToB
51 TB –> DP –> FO –> WD –> ToB
52 FO –> DP –> TB –> WD –> ToB
53 DP –> FO –> TB –> WD –> ToB
54 DP –> FO –> WD –> TB –> ToB
55 FO –> DP –> WD –> TB –> ToB
56 WD –> DP –> FO –> TB –> ToB
57 DP –> WD –> FO –> TB –> ToB
58 FO –> WD –> DP –> TB –> ToB
59 WD –> FO –> DP –> TB –> ToB
60 WD –> TB –> DP –> FO –> ToB
61 TB –> WD –> DP –> FO –> ToB
62 DP –> WD –> TB –> FO –> ToB
63 WD –> DP –> TB –> FO –> ToB
64 TB –> DP –> WD –> FO –> ToB
65 DP –> TB –> WD –> FO –> ToB
66 FO –> TB –> WD –> DP –> ToB
67 TB –> FO –> WD –> DP –> ToB
68 WD –> FO –> TB –> DP –> ToB
69 FO –> WD –> TB –> DP –> ToB
70 TB –> WD –> FO –> DP –> ToB
71 WD –> TB –> FO –> DP –> ToB
72 ToB –> TB –> FO –> DP –> WD
73 TB –> ToB –> FO –> DP –> WD
74 FO –> ToB –> TB –> DP –> WD
75 ToB –> FO –> TB –> DP –> WD
76 TB –> FO –> ToB –> DP –> WD
77 FO –> TB –> ToB –> DP –> WD
78 FO –> TB –> DP –> ToB –> WD
79 TB –> FO –> DP –> ToB –> WD
80 DP –> FO –> TB –> ToB –> WD
81 FO –> DP –> TB –> ToB –> WD
82 TB –> DP –> FO –> ToB –> WD
83 DP –> TB –> FO –> ToB –> WD
84 DP –> ToB –> FO –> TB –> WD
85 ToB –> DP –> FO –> TB –> WD
86 FO –> DP –> ToB –> TB –> WD
87 DP –> FO –> ToB –> TB –> WD
88 ToB –> FO –> DP –> TB –> WD
89 FO –> ToB –> DP –> TB –> WD
90 TB –> ToB –> DP –> FO –> WD
91 ToB –> TB –> DP –> FO –> WD
92 DP –> TB –> ToB –> FO –> WD
93 TB –> DP –> ToB –> FO –> WD
94 ToB –> DP –> TB –> FO –> WD
95 DP –> ToB –> TB –> FO –> WD
96 WD –> ToB –> TB –> FO –> DP
97 ToB –> WD –> TB –> FO –> DP
98 TB –> WD –> ToB –> FO –> DP
99 WD –> TB –> ToB –> FO –> DP
100 ToB –> TB –> WD –> FO –> DP
101 TB –> ToB –> WD –> FO –> DP
102 TB –> ToB –> FO –> WD –> DP
103 ToB –> TB –> FO –> WD –> DP
104 FO –> TB –> ToB –> WD –> DP
105 TB –> FO –> ToB –> WD –> DP
106 ToB –> FO –> TB –> WD –> DP
107 FO –> ToB –> TB –> WD –> DP
108 FO –> WD –> TB –> ToB –> DP
119 WD –> FO –> TB –> ToB –> DP
110 TB –> FO –> WD –> ToB –> DP
111 FO –> TB –> WD –> ToB –> DP
112 WD –> TB –> FO –> ToB –> DP
113 TB –> WD –> FO –> ToB –> DP
114 ToB –> WD –> FO –> TB –> DP
115 WD –> ToB –> FO –> TB –> DP
116 FO –> ToB –> WD –> TB –> DP
117 ToB –> FO –> WD –> TB –> DP
118 WD –> FO –> ToB –> TB –> DP
119 FO –> WD –> ToB –> TB –> DP

Next, we need security against active adversaries, ensure termination and make the protocol secure against replay and impersonation attacks.

However, I fear that, if I do this, then I won’t have any friends left to watch movies with… (although that would also solve the problem…)