You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/verifiability_doc.md
+11-24
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,20 @@
1
1
# vote verifiability
2
2
3
3
## Introduction
4
+
4
5
Verifiability is an important property to allows voters to check their vote has been cast unaltered, and that it has been registered correctly in the electronic ballot box.
5
6
6
7
The current d-voting (version num) didn't have this design yet. The current encrypted ballot logic is shown as follows:
8
+
7
9
```mermaid
8
10
sequenceDiagram
9
11
autonumber
10
-
11
12
participant User
12
13
participant Backend
13
14
participant NodeX
14
15
participant NodeY
15
-
16
16
User ->>+ NodeX: GET election info
17
17
NodeX ->>- User: Return election info.
18
-
19
18
User ->>+ Backend: POST /api/evoting/elections/<electionId>
20
19
Note over User: data: {"Ballot": ...}
21
20
Note over User: encrypt ballot via Elgamal encryption using electionPubKey
@@ -24,11 +23,9 @@ The current d-voting (version num) didn't have this design yet. The current encr
24
23
Note over Backend: add userID inside payload.
25
24
Note over Backend: sign = kyber.sign.schnorr.sign(edCurve, scalar, hash);
26
25
Backend ->>+ NodeX: POST /evoting/elections/
27
-
28
26
Note over Backend, NodeX: data: {"Payload": dataStrB64, "Signature": ""}
29
27
Note over NodeX: verify and execute, then boardcast
30
28
NodeX ->> NodeY: boardcase via gRPC
31
-
32
29
NodeX ->>- Backend: 200 OK text/plain
33
30
Backend ->>- User: 200 OK text/plain
34
31
```
@@ -37,68 +34,62 @@ As the picture show, the Frontend will encrypt the ballot using Elgamal encrypti
37
34
38
35
In this document, we aim to design an implementation to achieve verifiability of the voters' encrypted vote without leaking ballot information to others.
39
36
40
-
41
37
## Requirements
38
+
42
39
The voter should able to verify their encrypted ballot in Frontend.
43
40
The encrypted vote remain confidentiality from others.
44
41
The Node shall have an endpoint to get voter encrypted ballot.
45
42
46
-
47
43
## Related work
48
44
49
45
### Strawman approach
46
+
50
47
The strawman design is just using a fixed seed to encrypt the ballot which make the encrypted ballot deterministic. Then the user can verify the encrypted ballot on the chain by just encrypt a new ballot with the same option.
51
48
52
49
However this design actually will break the confidentialy property of our d-voting system. An adversary be able to decrypt the user's ballot by recording the ciphertext of the encrypted ballot in every possible choice. Then the adversary can just check the ciphertext on the chain and will notify the voter ballot.
53
50
54
51
Thus we should keep some secret only to the voter himselves or the backend to prevent adversary unlock the ballot.
55
52
56
53
### Swiss POST evoting system
54
+
57
55
Swiss POST implement their own [evoting system](https://www.evoting.ch/en) which support the verifiability of the casted ballot.
58
56
59
57
Their protocol takes place between a User, a trusted device, and an untrusted device. In this example the user will be Alice, the trusted device will be her cellphone, and the untrucsted device will be the evoting backend system. After casting the vote, user will received a encBallotReport (via QR code). Then the user can verify if their vote has been cast correctly or not.
58
+
60
59
```mermaid
61
60
sequenceDiagram
62
61
autonumber
63
-
64
62
participant User
65
63
participant TrustedDevice
66
64
participant Backend
67
65
participant Node
68
-
69
66
User ->>+ TrustedDevice: cast vote
70
67
TrustedDevice ->>+ Backend: plain ballot
71
68
Note Over Backend: Generated random voteID, use it as RNG to generate encBallotReport.
72
69
Backend ->> Node: Send encBallotReport to NodeNetwork
TrustedDevice ->>- User: show encBallot Report (via QR code etc)
75
-
76
72
Note Over User: Use the voteID and verify the encBallotReport
77
73
Note Over User: verify via Hash of report etc.
78
-
79
74
```
80
75
81
-
82
76
## Proposed solution
77
+
83
78
According to our requirements, we assume that the frontend is trusted. If frontend is compromised, the adversary can already know the plaintext of the ballot which breaks the confidentiality of the ballot.
84
79
85
80
When the frontend after the frontend encrypted the ballot (use default non-deterministic encryption), it can hash the encrypted ballot and show the hash str of the encrypted ballot. The frontend sends the encrypted ballot to the backend.
86
81
87
82
A user can then check the hash of the vote by looking at the details of the form if the hash of the vote matches the one he received.
88
83
89
-
90
84
```mermaid
91
85
sequenceDiagram
92
86
autonumber
93
-
94
87
participant User
95
88
participant Backend
96
89
participant NodeX
97
90
participant NodeY
98
-
99
91
User ->>+ NodeX: GET election info
100
92
NodeX ->>- User: Return election info.
101
-
102
93
User ->>+ Backend: POST /api/evoting/elections/<electionId>
103
94
Note over User: data: {"Ballot": ...}
104
95
Note over User: encrypt ballot via Elgamal encryption using electionPubKey
@@ -108,14 +99,11 @@ sequenceDiagram
108
99
Note over Backend: add userID inside payload.
109
100
Note over Backend: sign = kyber.sign.schnorr.sign(edCurve, scalar, hash);
110
101
Backend ->>+ NodeX: POST /evoting/elections/
111
-
112
102
Note over Backend, NodeX: data: {"Payload": dataStrB64, "Signature": ""}
113
103
Note over NodeX: verify and execute, then boardcast
114
104
NodeX ->> NodeY: boardcase via gRPC
115
-
116
105
NodeX ->>- Backend: 200 OK text/plain
117
106
Backend ->>- User: 200 OK text/plain + voteSecret
118
-
119
107
User ->>+ NodeX: get form details
120
108
NodeX ->>- User: return form details and hash of encrypted vote.
121
109
Note over User: check the hash of the vote is the same or not.
@@ -124,6 +112,7 @@ sequenceDiagram
124
112
However, this design is still not perfect because it didn't have coercion resistance property because coercers will know the Hash of encrypted ballot during the vote. We can achieve coercion resistance via moved the encryption process to the backend and use benaloh challenge protocol to encrypt the vote. But currently our system didn't require coercion resistance thus we will not implement this.
125
113
126
114
### frontend
115
+
127
116
- Edit the submit vote function
128
117
- hash the encrypted ballot and show to the user.
129
118
- Edit form details page to show the hash of ballot.
@@ -132,26 +121,26 @@ However, this design is still not perfect because it didn't have coercion resist
132
121
- User can check if the hash they received is the same as the hash on the details.
133
122
134
123
### Blockchain node
135
-
- edit api "/evoting/forms/{formID}", add the hash of the ballot to the form structure.
136
124
125
+
- edit api "/evoting/forms/{formID}", add the hash of the ballot to the form structure.
137
126
138
127
## Extension coercion protection
128
+
139
129
Here we proposed a solution to protect against coercion. However, this will not be implemented because it will need to change most of the current architecture. We will implement the Benaloh challenge in this design.
140
130
141
131
### Benaloh Challenge
132
+
142
133
[Benaloh Challenge](https://docs.rs/benaloh-challenge/latest/benaloh_challenge/) (also known as an Interactive Device Challenge), a crytographic technique to ensure the honesty of an untrusted device. While orignially conceived in the context of voting using an electronic device, it is useful for all untrusted computations that are deterministic with the exception of using an RNG. Most cryptography fits in this category.
143
134
144
135
This protocol takes place between a user, a trusted device, and an untrusted device. In this example the user will be Alice, the trusted device will be her cellphone, and the untrusted device will be a voting machine. The voting machine needs to do some untrusted computation using an RNG (encrypting Alice's vote), the details of which need to be kept secret from Alice so she can't prove to a 3rd party how she voted. However, the voting machine needs to assure Alice that it encrypted the vote correctly and didn't change her vote, without letting her know the secret random factors it used in it's encryption.
145
136
146
137
```mermaid
147
138
sequenceDiagram
148
139
autonumber
149
-
150
140
participant User
151
141
participant TrustedDevice
152
142
participant Backend
153
143
participant Node
154
-
155
144
User ->>+ TrustedDevice: marks ballot
156
145
TrustedDevice ->>+ Backend: plain ballot
157
146
Note Over Backend: Encrypted her marked ballot (using random factors from an RNG)
@@ -160,10 +149,8 @@ sequenceDiagram
160
149
TrustedDevice ->>- User: show Report (via QR code etc)
161
150
Note Over User: if user decide to "cast", process is done
162
151
Note Over User: if he/she choose challenge, she can scan the QR (hash of encVote) and select challenges.
0 commit comments