Skip to content

Commit 5f7c354

Browse files
committed
edit space and blank line
1 parent d3bf85b commit 5f7c354

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

docs/verifiability_doc.md

+11-24
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# vote verifiability
22

33
## Introduction
4+
45
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.
56

67
The current d-voting (version num) didn't have this design yet. The current encrypted ballot logic is shown as follows:
8+
79
```mermaid
810
sequenceDiagram
911
autonumber
10-
1112
participant User
1213
participant Backend
1314
participant NodeX
1415
participant NodeY
15-
1616
User ->>+ NodeX: GET election info
1717
NodeX ->>- User: Return election info.
18-
1918
User ->>+ Backend: POST /api/evoting/elections/<electionId>
2019
Note over User: data: {"Ballot": ...}
2120
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
2423
Note over Backend: add userID inside payload.
2524
Note over Backend: sign = kyber.sign.schnorr.sign(edCurve, scalar, hash);
2625
Backend ->>+ NodeX: POST /evoting/elections/
27-
2826
Note over Backend, NodeX: data: {"Payload": dataStrB64, "Signature": ""}
2927
Note over NodeX: verify and execute, then boardcast
3028
NodeX ->> NodeY: boardcase via gRPC
31-
3229
NodeX ->>- Backend: 200 OK text/plain
3330
Backend ->>- User: 200 OK text/plain
3431
```
@@ -37,68 +34,62 @@ As the picture show, the Frontend will encrypt the ballot using Elgamal encrypti
3734

3835
In this document, we aim to design an implementation to achieve verifiability of the voters' encrypted vote without leaking ballot information to others.
3936

40-
4137
## Requirements
38+
4239
The voter should able to verify their encrypted ballot in Frontend.
4340
The encrypted vote remain confidentiality from others.
4441
The Node shall have an endpoint to get voter encrypted ballot.
4542

46-
4743
## Related work
4844

4945
### Strawman approach
46+
5047
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.
5148

5249
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.
5350

5451
Thus we should keep some secret only to the voter himselves or the backend to prevent adversary unlock the ballot.
5552

5653
### Swiss POST evoting system
54+
5755
Swiss POST implement their own [evoting system](https://www.evoting.ch/en) which support the verifiability of the casted ballot.
5856

5957
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+
6059
```mermaid
6160
sequenceDiagram
6261
autonumber
63-
6462
participant User
6563
participant TrustedDevice
6664
participant Backend
6765
participant Node
68-
6966
User ->>+ TrustedDevice: cast vote
7067
TrustedDevice ->>+ Backend: plain ballot
7168
Note Over Backend: Generated random voteID, use it as RNG to generate encBallotReport.
7269
Backend ->> Node: Send encBallotReport to NodeNetwork
7370
Backend ->>- TrustedDevice: encBallotReport + voteID
7471
TrustedDevice ->>- User: show encBallot Report (via QR code etc)
75-
7672
Note Over User: Use the voteID and verify the encBallotReport
7773
Note Over User: verify via Hash of report etc.
78-
7974
```
8075

81-
8276
## Proposed solution
77+
8378
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.
8479

8580
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.
8681

8782
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.
8883

89-
9084
```mermaid
9185
sequenceDiagram
9286
autonumber
93-
9487
participant User
9588
participant Backend
9689
participant NodeX
9790
participant NodeY
98-
9991
User ->>+ NodeX: GET election info
10092
NodeX ->>- User: Return election info.
101-
10293
User ->>+ Backend: POST /api/evoting/elections/<electionId>
10394
Note over User: data: {"Ballot": ...}
10495
Note over User: encrypt ballot via Elgamal encryption using electionPubKey
@@ -108,14 +99,11 @@ sequenceDiagram
10899
Note over Backend: add userID inside payload.
109100
Note over Backend: sign = kyber.sign.schnorr.sign(edCurve, scalar, hash);
110101
Backend ->>+ NodeX: POST /evoting/elections/
111-
112102
Note over Backend, NodeX: data: {"Payload": dataStrB64, "Signature": ""}
113103
Note over NodeX: verify and execute, then boardcast
114104
NodeX ->> NodeY: boardcase via gRPC
115-
116105
NodeX ->>- Backend: 200 OK text/plain
117106
Backend ->>- User: 200 OK text/plain + voteSecret
118-
119107
User ->>+ NodeX: get form details
120108
NodeX ->>- User: return form details and hash of encrypted vote.
121109
Note over User: check the hash of the vote is the same or not.
@@ -124,6 +112,7 @@ sequenceDiagram
124112
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.
125113

126114
### frontend
115+
127116
- Edit the submit vote function
128117
- hash the encrypted ballot and show to the user.
129118
- 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
132121
- User can check if the hash they received is the same as the hash on the details.
133122

134123
### Blockchain node
135-
- edit api "/evoting/forms/{formID}", add the hash of the ballot to the form structure.
136124

125+
- edit api "/evoting/forms/{formID}", add the hash of the ballot to the form structure.
137126

138127
## Extension coercion protection
128+
139129
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.
140130

141131
### Benaloh Challenge
132+
142133
[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.
143134

144135
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.
145136

146137
```mermaid
147138
sequenceDiagram
148139
autonumber
149-
150140
participant User
151141
participant TrustedDevice
152142
participant Backend
153143
participant Node
154-
155144
User ->>+ TrustedDevice: marks ballot
156145
TrustedDevice ->>+ Backend: plain ballot
157146
Note Over Backend: Encrypted her marked ballot (using random factors from an RNG)
@@ -160,10 +149,8 @@ sequenceDiagram
160149
TrustedDevice ->>- User: show Report (via QR code etc)
161150
Note Over User: if user decide to "cast", process is done
162151
Note Over User: if he/she choose challenge, she can scan the QR (hash of encVote) and select challenges.
163-
164152
TrustedDevice ->>+ Backend: send challenge request
165153
Backend ->>- TrustedDevice: give the marked-ballot and random factors RNG.
166-
167154
Note Over User, TrustedDevice: checks commitment by re-computing commitment using markedBallot & RNG
168155
Note Over User, TrustedDevice: if different, Backend is compromised
169156
Note Over User, TrustedDevice: if same, return to step 1, (remark ballot)

0 commit comments

Comments
 (0)