129
Cryptography for electronic voting Bogdan Warinschi University of Bristol 1

Cryptography for electronic voting

  • Upload
    bunny

  • View
    39

  • Download
    1

Embed Size (px)

DESCRIPTION

Cryptography for electronic voting. Bogdan Warinschi University of Bristol. Aims and objectives. Cryptographic tools are amazingly powerful Models are useful, desirable, and difficult to get right Cryptographic proofs are not difficult - PowerPoint PPT Presentation

Citation preview

Page 1: Cryptography  for electronic voting

Cryptography for electronic votingBogdan Warinschi University of Bristol

1

Page 2: Cryptography  for electronic voting

Aims and objectives

• Cryptographic tools are amazingly powerful• Models are useful, desirable, and difficult to get

right• Cryptographic proofs are not difficult

• Me: Survey basic cryptographic primitives and their models

• Me: Sketch one (several?) cryptographic proofs• You (and me): Ask questions• You: I assume you know groups, RSA, DDH 2

Page 3: Cryptography  for electronic voting

Useful, desirable, difficult to get

3

Page 4: Cryptography  for electronic voting

Design-then-break paradigm

4

• …attack found• …attack found• …attack found• …no attack found

Guarantees: no attack has been found yet

Page 5: Cryptography  for electronic voting

Security models

5

Mathematical descriptions:• What a system is• How a system works• What is an attacker• What is a break

Advantages: clarify security notion; allows for security proofs (guarantees within clearly established boundaries) Shortcomings: abstraction – implicit assumptions, details are missing (e.g. trust in hardware, side-channels)

Page 6: Cryptography  for electronic voting

Voting scheme

6

v1

vn

v2 (v1,v2,…,vn)

• Votes: v1,v2,…vn in V• Result function: :V* Results• E.g. V={0,1}, (v1,v2,…,vn)= v1+v2+…+vn

Page 7: Cryptography  for electronic voting

Complex elections

• 2 candidates; majority decision• N candidates:

• Limited vote: vote for a number t of candidates• Approval vote: vote for any number of candidates• Divisible vote: distribute t votes between

candidates• Borda vote: t votes for the first preference, t-1 for

the second, etc

7

Page 8: Cryptography  for electronic voting

Wish list

• Eligibility: only legitimate voters vote; each voter votes once

• Fairness: voting does not reveal early results• Verifiability: individual, universal• Privacy: no information about the individual votes

is revealed• Receipt-freeness: a voter cannot prove s/he voted

in a certain way• Coercion-resistance : a voter cannot interact with

a coercer to prove that s/he voted in a certain way 8

Page 9: Cryptography  for electronic voting

Today: privacy

• Privacy-relevant cryptographic primitives• Commitment schemes, blind signature schemes,

asymmetric encryption, secret sharing• Privacy-relevant techniques

• Homomorphicity, rerandomization, threshold cryptography

• Security models:• for several primitives and for vote/ballot secrecy

• Voting schemes: • FOO, Minivoting scheme 9

Page 10: Cryptography  for electronic voting

Tomorrow: (mainly) verifiability

• What’s left of privacy• Verifiability-relevant cryptographic primitives

• Zero knowledge• Zero knowledge• Zero knowledge• Applications of zero knowledge

• The Helios internet voting scheme

10

Page 11: Cryptography  for electronic voting

Game based models

11

Chal

leng

er

Query

Answer

0/1

Security: is secure if for any adversary the probability that the challenger outputs 1 is close to some fixed constant (typically 0, or ½)

𝜋

Page 12: Cryptography  for electronic voting

A VOTING SCHEME 12

Page 13: Cryptography  for electronic voting

Fujisaki Okamoto Ohta [FOO92]

13

Voters

Election authorities

Tallying authorities

1.Registration phase2.Voting phase3.Tallying phase

Page 14: Cryptography  for electronic voting

FOO - Registration

14

My vote

Page 15: Cryptography  for electronic voting

FOO - Registration

15

Special glueCan only be

unglued with

Page 16: Cryptography  for electronic voting

FOO - Registration

16

Carbon paper

Page 17: Cryptography  for electronic voting

FOO - Registration

17

Page 18: Cryptography  for electronic voting

FOO - Registration

18

John Smith

Page 19: Cryptography  for electronic voting

FOO - Registration

19

John Smith

John Smith : registered voter who didn’t vote

yet

Page 20: Cryptography  for electronic voting

FOO - Registration

20

Valid!

Page 21: Cryptography  for electronic voting

FOO - Registration

21

Valid!

Page 22: Cryptography  for electronic voting

Valid!

FOO - Registration

22

Page 23: Cryptography  for electronic voting

Valid!

FOO – Voting phase

23

Valid!

Valid!

Valid!

Page 24: Cryptography  for electronic voting

Valid!

FOO – Voting phase

24

Valid!

Valid!

Valid!

Anon

ymou

s Ch

anne

l

Page 25: Cryptography  for electronic voting

Valid!

FOO – Tallying phase

25

Valid!

Valid!

Valid!Anon

ymou

s Ch

anne

l

Page 26: Cryptography  for electronic voting

Valid!

FOO – Tallying phase

26

Valid!

Valid!

Valid!Anon

ymou

s Ch

anne

l

Page 27: Cryptography  for electronic voting

Vote 1

Vote 2

Vote 3

Vote N

FOO – Tallying phase

27Valid!

Valid!

Valid!

Valid!Anon

ymou

s Ch

anne

l

…and the winner is:

Page 28: Cryptography  for electronic voting

CRYPTOGRAPHIC IMPLEMENTATION 28

Page 29: Cryptography  for electronic voting

Digital signature schemes

29

SignskVerifyvkm

s Yes/no

Setup Kgν params

sk vk

m

Page 30: Cryptography  for electronic voting

Digital signature schemes

• Syntax:• Keygen(ν): generates (sk,vk) secret signing key,

verification key• Sign(sk,m): the signing algorithm produces a

signature s on m• Verify(vk,m,s): the verification algorithm

outputs accept/reject

30

Page 31: Cryptography  for electronic voting

Unforgeability under chosem message attack (UF-CMA)

31

par Setup(n)

(vk,sk ) Kg (par)

si Signsk(mi)

win Verify(vk,m*,s*) and m*≠mi

Public Key

vk

mi

si

Forgery(m*,s*)

𝜋

win

UF-CMA security: PPT attackers negligible function f n0 security parameters n ≥ n0 Prob [win] ≤ f(n)

Defining the security of=(Setup,Kg,Sign,Verify)

Good definition?

Page 32: Cryptography  for electronic voting

Full Domain Hash

• Syntax:• Keygen(ν): generate RSA modulus N=PQ, and

d and e such that ed=1 mod (N). Set H be a good hash function that hashes in ZN

*. Set vk=(H,N,e) and sk=(H,N,d).

• Sign((H,N,d),m): output H(m)d mod N• Verify((N,e),m,s): accept iff se= H(m) mod

• Security: UF-CMA secure in the random oracle model under the RSA assumption 32

Page 33: Cryptography  for electronic voting

Blind -Sign

Blind digital signature schemes

33

Ssk Verifyvk

sYes/no

Setup Kgν params

sk vk

m

U

Page 34: Cryptography  for electronic voting

Blind digital signature schemes

• Syntax:• Keygen(ν): generates (sk,vk) secret signing key,

verification key• Blind-Sign: protocol between user

U(m,vk) and signer S(sk); the user obtains a signature s on m

• Verify(vk,m,s): the verification algorithm outputs accept/reject

34

Page 35: Cryptography  for electronic voting

Blind digital signature schemes

• Security:• Blindness: a malicious signer obtains no

information about the message being signed

• Unforgeability:...

35

Page 36: Cryptography  for electronic voting

Chaum’s blind signature scheme

36gcd(r, N) = 1

=

User (m,(N,e)) Signer (d,N)

• Key generation(): generate RSA modulus N=PQ, and d and e such that ed=1 mod (N). Set vk=(N,e) and sk=(N,d)

• Blind-sign:

Page 37: Cryptography  for electronic voting

Chaum’s blind signature scheme

37gcd(r, N) = 1

=

User (m,(N,e)) Signer (d,N)

• Key generation(): generate RSA modulus N=PQ, and d and e such that ed=1 mod (N). Set vk=(N,e) and sk=(N,d)

• Blind-sign:

Page 38: Cryptography  for electronic voting

slide 38

Commitment schemes

• Temporarily hide a value, but ensure that it cannot be changed later

• 1st stage: Commit• Sender electronically “locks” a message in an

envelope and sends the envelope to the Receiver

• 2nd stage: Decommit• Sender proves to the Receiver that a certain

message is contained in the envelope

Page 39: Cryptography  for electronic voting

Commitment schemes

39

Commit DecommitmC,d

Yes/no

Setupν

params params

Page 40: Cryptography  for electronic voting

slide 40

Commitment schemes

• Syntax:• Setup(): outputs scheme parameters• Commit(x;r): outputs (C,d):

• C is a commitment to x• d is decommiting information

• Decommit(C,x,d): outputs true/false• Functionality: If (C,d) was the output of

Commit(x;r) then Decomit(C,x,d) is true

Page 41: Cryptography  for electronic voting

slide 41

Security of Commitment Schemes

• Hiding• The commitment does not reveal any information about

the committed value• If receiver is probabilistic polynomial-time, then

computationally hiding; if receiver has unlimited computational power, then perfectly hiding

• Binding• There is at most one value that an adversarial commiter

can successfully “decommit” to• Perfectly binding vs. computationally binding

Page 42: Cryptography  for electronic voting

Exercises

• (easy): Can a commitment scheme be both perfectly hiding and binding?

• (tricky): Let G be a cyclic group and g a generator for G. Consider the commitment scheme (Commit, Decommit) for elements in {1,2,…,|G|}:• Commit(x) output C=gx and d=x• Decommit(C,d) is 1 if gx=C and 0 otherwise

• Is it binding (perfectly, computationally?)

• Is it hiding (perfectly/computationally)? 42

Page 43: Cryptography  for electronic voting

slide 43

Pedersen Commitment Scheme• Setup: Generate a cyclic group G of prime order,

with generator g. Set • h=ga for random secret a in [|G|]• G,g,h are public parameters (a is kept secret)

• Commit(x;r): to commit to some x [|G|], choose random r [|G|]. The commitment to x is C=gxhr (Notice that C=gx(ga)r=gx+ar)

• Decommit(C,x,r): check C=gxhr

Page 44: Cryptography  for electronic voting

slide 44

Security of Pedersen Commitments

• Perfectly hiding• Given commitment c, every value x is equally likely to be

the value commited in c• Given x, r and any x’, exists a unique r’ such that gxhr = gx’hr’

r’ = (x-x’)a-1 + r (but must know a to compute r’)• Computationally binding

• If sender can find different x and x’ both of which open commitment c=gxhr, then he can solve discrete log• Suppose sender knows x,r,x’,r’ s.t. gxhr = gx’hr’

• Because h=ga mod |G|, this means x+ar = x’+ar’ mod |G|• Sender can compute a as (x’-x)(r-r’)-1

Page 45: Cryptography  for electronic voting

Fujisaki Okamoto Ohta (FOO)

• (medium) Specify the Fujisaki, Okamoto, Ohta protocol [you may assume two-move blind signing protocols, like Chaum’s]

45

Page 46: Cryptography  for electronic voting

Some difficulties with FOO

• Requires anonymous channels (Tor?)

• Voters involved in all of the tallying phases

• Only individual verifiability

46

Page 47: Cryptography  for electronic voting

ASYMMETRIC ENCRYPTION SCHEMES 47

Page 48: Cryptography  for electronic voting

Asymmetric encryption

48

EncpkDecskm

C m

Setup Kgν params

pk sk

Page 49: Cryptography  for electronic voting

Syntax

49

• Setup(ν): fixes parameters for the scheme

• KG(params): randomized algorithm that generates (PK,SK)

• ENCPK(m): randomized algorithm that generates an encryption of m under PK

• DECSK(C): deterministic algorithm that calculates the decryption of C under sk

Page 50: Cryptography  for electronic voting

Functional properties

• Correctness: for any PK,SK and M:

DECSK (ENCPK (M))=M

• Homomorphicity: for any PK, the function ENCPK ( ) is homomorphic

ENCPK(M1) ENCPK(M2) = ENCPK(M1+M2)50

Page 51: Cryptography  for electronic voting

(exponent) ElGamal

51

• Setup(ν): produces a description of (G,) with generator g

• KG(G, g): x {1,…,|G |}; X gx

output (X,x)• ENCX(m): r {1,…,|G |};

(R,C) (gr, gmXr); output (R,C)

• DECx((R,C)): find t such that gt=C/Rx

output m

Page 52: Cryptography  for electronic voting

Functional properties

• ENCX(m): (R,C) (gr, gmXr); output (R,C)

• DECx((R,C)): find t such that gt=C/Rx

output t

• Correctness: output t such that gt = gmXr/gxr = gmXr/Xr=gm

• Homorphicity:(gr, gv1Xr) (gs, gv2Xs) = (gq, gv1+v2Xq)

where q=r+s52

Page 53: Cryptography  for electronic voting

IND-CPA security

53

par Setup() (PK,SK ) Kg (par)

b C EncPK(Mb)

win d=b

Public Key

PK

win

Security for 𝜋=(Setup ,Kg ,Enc ,Dec )

M0,MI

C

Guess d

𝜋

Theorem:If the DDH problem is hard in G then the ElGamal encryption scheme is IND-CPA secure.

Good definition?

is IND-CPA secure if Pr[win] ~ 1/2

Page 54: Cryptography  for electronic voting

SINGLE PASS VOTING SCHEME 54

Page 55: Cryptography  for electronic voting

BBInformal

55

C1 ENCPK(v1)

P1: v1

C2 ENCPK(v2)P2: v2

Cn ENCPK(vn)Pn: vn

C1

C2

Cn

SK

PK

Use SK to obtain v1,… vn. Compute and return

(v1,v2,…,vn)

Page 56: Cryptography  for electronic voting

Syntax of SPS schemes

• Setup(ν): generates (x,y,BB) secret information for tallying, public information parameters of the scheme, initial BB

• Vote(y,v): the algorithm run by each voter to produce a ballot b

• Ballot(BB,b): run by the bulleting board; outputs new BB and accept/reject

• Tallying(BB,x): run by the tallying authorities to calculate the final result

56

Page 57: Cryptography  for electronic voting

An implementation: Enc2Vote

• =(KG,ENC,DEC) be a homomorphic encryption scheme. Enc2Vote() is:

• Setup(ν): KG generates (SK,PK,[]) • Vote(PK,v): b ENCPK(v)• Process Ballot([BB],b): [BB] [BB,b]• Tallying([BB],x): where [BB] = [b1b2,…,bn] b = b1b2 … bn

• result DECSK(x,b) output result

57

Page 58: Cryptography  for electronic voting

PKAttack against privacy

58

SKC1 ENCPK(v1)P1: v1

C2 ENCPK(v2)P2: v2

C1P3

• Assume that votes are either 0 or 1• If the result is 0 or 1 then v1 was 0, otherwise v1

was 1

C1

C2

C1

FIX: weed out equal ciphertexts

BBUse SK to obtain v1 ,v2, v3

Out (v1 ,v2, v3 ) = 2v1 + v2

Page 59: Cryptography  for electronic voting

New attack

59

C1 ENCPK(v1)P1: v1

C2 ENCPK(v2)P2: v2

CP3

PK

Calculate C0=ENCPK(0)and C=C1C0=ENCPK(v1)

C1

C2

C

FIX: Make sure ciphertexts cannot be mauled and weed out

equal ciphertexts

BBSK

Use SK to obtain v1 ,v2, v3

Out (v1 ,v2, v3 ) = 2v1 + v2

Page 60: Cryptography  for electronic voting

Non-malleable encryption (NM-CPA)

60

Params Setup() (PK,SK ) Kg (params)

b C EncPK(Mb)

Mi DecPK(Ci), for i=1..n

win d=b

Public Key

PK

win

Nonnmalleability of 𝜋=(Setup, Kg , Enc , Dec)

M0,M1

C

Guess d

𝜋

C1, C2 …,Cn

M1, M2,…,Mn

Good definition?

Page 61: Cryptography  for electronic voting

(NM-CPA) – alternative definition

61

Params Setup() (PK,SK ) Kg (params)

M0,M1 Dist C EncPK(M0)

M* DecPK(C*)

Public Key

PK

Nonnmalleability of 𝜋=(Setup, Kg , Enc , Dec)

Dist

C

𝜋

Rel,C*

NM-CPA security: PPT attackers negligible function f such that | Prob [Rel(M0,M*)] - Prob [Rel(M1,M*)] | ≤ f(n)

Page 62: Cryptography  for electronic voting

ElGamal is not non-malleable

62

• Any homomorphic scheme is malleable:• Given EncPK(m) can efficiently compute

EncPK(m+1) (by multiplying with an encryption of 1)

• For ElGamal: • submit 0,1 as the challenge messages• Obtain c=(R,C)• Submit (R,Cg) for decryption. If

response is 1, then b is 0, if response is 2 then b is 1

Page 63: Cryptography  for electronic voting

BB0 BB1

Ballot secrecy for SPS [BCPSW11]

63

C0 VotePK(h0)

C

h 0,h 1

C1

C

C1 VotePK(h1)

Sees BBb

d win d=b

result rTallySK(BB0)

C0

CC

PK SK

win

b

Page 64: Cryptography  for electronic voting

65

Theorem: If s a non-malleable encryption scheme then Env2Vote() has vote secrecy.

PK

SK

h 0,h 1 BB

Ci

C ENCPK(hb)

dresult

rF(H0,V)

h0,h1

C1, C2,…, Ct

d

v1, v2,…, vt

PK

CCi

PKParams Setup() (PK,SK ) Kg (params)

b C EncPK(Mb)

Mi DecPK(Ci), for i=1..n

win d=b

Page 65: Cryptography  for electronic voting

Exercises

• (easy) Define the hiding property for commitment schemes

• (medium) Modify the ballot secrecy experiment to accommodate the FOO scheme

• (difficult) Does FOO have vote secrecy?

66

Page 66: Cryptography  for electronic voting

More complex elections

• N voters, k candidates and (say) approval voting• Allocate pk1,pk2,…,pkk one for each candidate• Voter i: decide on vij in {0,1}. His ballot is:

• Tallying is done for each individual key• Ballot size: k·|ciphertext| (Wasteful?) 67

Encpk1(vi1) Encpk2(vi2) Encpk2(vik)

Page 67: Cryptography  for electronic voting

More complex elections

• N voters, k candidates (N is the maximum number of votes for any candidate)

• Encode the choices in a single vote:

• The choices of user j encoded as: ivijNi

• K · c·|log N| (better?) 68

vi1 vi2 vi3 vik

log N bits

Page 68: Cryptography  for electronic voting

Paillier encryption• Public key N=PQ=(2p+1)(2q+1)• Secret key d satisfying d=1 mod N, d=0 mod 4pq• Encrypt vote v ZN using randomness R ZN*

C = (1+N)vRN mod N2

• Decrypt by computing

v = (Cd-1 mod N2)/N

Page 69: Cryptography  for electronic voting

Correct decryption• Public key N=PQ=(2p+1)(2q+1)• Secret key d satisfying d=1 mod N, d=0 mod 4pq• The multiplicative group ZN2* has size 4Npq• We also have (1+N)N = 1 + N·N + ... ≡ 1 mod N2

• CorrectnessCd = ((1+N)vRN)d = (1+N)vd RNd

= (1+N)vd R4Npqk ≡ (1+N)v mod N2

(1+N)v = 1+vN+ N2+... ≡ 1+vN mod N2

(Cd-1 mod N2)/N = v

Page 70: Cryptography  for electronic voting

Homomorphicity• Public key N=PQ=(2p+1)(2q+1)• Encrypt vote v ZN using randomness R ZN*

C = (1+N)vRN mod N2

• Homomorphic

(1+N)vRN · (1+N)wSN

≡ (1+N)v+w(RS)N mod N2

Page 71: Cryptography  for electronic voting

PKAttack against privacy

72

SKC1 ENCPK(v1)P1: v1

C2 ENCPK(v2)P2: v2

C3 ENCPK(v3)P3

C1

C2

C3

BB

Page 72: Cryptography  for electronic voting

PKAttack against privacy

73

C1 ENCPK(v1)P1: v1

C2 ENCPK(v2)P2: v2

C3 ENCPK(v3)P3

C1

C2

C3

BB

Page 73: Cryptography  for electronic voting

Threshold encryption

75

Encpk( )

Decsk1( )

Decsk2( )

DecskN( )

m

Com

bineC

C

C

m1

m2

mN

m

Setup Kgν params

pk sk1

Page 74: Cryptography  for electronic voting

Threshold encryption

• Syntax:• Key Generation(n,k):

outputs pk,vk,(sk1, sk2, …,skn) • Encrypt(pk,m): outputs a ciphertext C• Decrypt(C,ski): outputs mi • ShareVerify(pk,vk,C, mi): outputs

accept/reject • Combine(pk,vk,C,{mi1,mi2,…,mik}): outputs a

plaintext m 76

Page 75: Cryptography  for electronic voting

(exponent) ElGamal

77

• Setup(ν): produces a description of (G,) with generator g

• KG(G, g): x {1,…,|G |}; X gx

output (X,x)• ENCX(m): r {1,…,|G |};

(R,C) (gr, gmXr); output (R,C)

• DECx((R,C)): find t such that gt=C/Rx

output m

Page 76: Cryptography  for electronic voting

n-out-of-n threshold El-Gamal

• Setup(n): produces group G with generator g

• Key Generation(n,n):• For party party Pi select random xi in {1,2,…,|G|},

set ski=xiand set X=gΣxi , vk=(gx1,gx2,…,gxn), output (X,vk,sk)

• ENCX(m): r {1,…,|G |}; (R,C) (gr, gmXr);

output (R,C) 78

Page 77: Cryptography  for electronic voting

Threshold decryption

79

• Party Pi has (xi, Xi=gxi); x=x1 + x2 +…+xk;

X=gΣxi = gx

• ShareDecrypt((R,C),xi): Pi: yiRxi ; send yi

• Combine((R,C),y1,…,yn):

Calculate y y1…yn Output: C/y = C/Rx

Page 78: Cryptography  for electronic voting

Private but not robust

80

…and I hid my secret key

Page 79: Cryptography  for electronic voting

Shamir k out of n threshold secret sharing:

81

To share secret s among n parties:• Pick a random polynomial of degree k-1

P(X)= a0+a1X+…+ak-1Xk-1, with s=a0

• Set the share of party i to si=P(i)

• Any set I of k parties can reconstruct P as P(X)= Σs (X-j)/(i-j)

(the sum is for iI the product is over jI with j≠i)

• P(0)=s

Page 80: Cryptography  for electronic voting

k-out-of-n threshold ElGamal

• Key generation: • s1,s2,…,sn as in the Shamir secret sharing scheme. • The public key is X=gs the verification key is

X1=gs1, X2=gs2,…,Xn=gsn..

• Party i is given si=P(i)

• Partial decryption (si,(R,C)): • party i outputs mi=Rsi

• Combine((R,C),m1,…,mN): Rs = RP(0) = RΣsi (-j)/(i-j)

= Rsici

where cj= (-j)/(i-j) (the product is over i I-{j}) decrypt as before

82

Page 81: Cryptography  for electronic voting

Mixnets

• Homomorphic tallying great, but not for complex functions• Instead of homomorphically computing

Encpk(f(v1,v2,…,vn)) simply decrypt all votes

83

Page 82: Cryptography  for electronic voting

Rerandomizable encryption

84

vote vote0 =

Encpk(m;r) Encpk(0;s)= Encpk(m;r+s)

(gr, gmXr) (gs, g0Xs) = (gr+s, gmXr+s)

Page 83: Cryptography  for electronic voting

Mixnet

85

vote1

vote2

voteN

vote1

vote2

voteN

vote (2)

vote (N)

vote (1)

Page 84: Cryptography  for electronic voting

Mixnet

86

vote1

vote2

voteN

vote (2)

vote (N)

vote ( 1)

vote(1)

vote (N)

vote (2)

=;

Page 85: Cryptography  for electronic voting

Misbehaving parties - voters

87

SKC1 ENCPK(-1)

C2 ENCPK(-1)

CN ENCPK(1)

BBvote1

vote2

voteN

vote (2)

vote (N)

vote ( 1)

CN ENCPK(3)

Page 86: Cryptography  for electronic voting

Misbehaving parties - mixers

88

SKC1 ENCPK(-1)

C2 ENCPK(-1)

CN ENCPK(1)

BBvote1

vote2

voteN

Vote*

vote *

Vote*

CN ENCPK(3) Vote*

Page 87: Cryptography  for electronic voting

Misbehaving parties – tally authorities

89

SKC1 ENCPK(-1)

C2 ENCPK(-1)

CN ENCPK(1)

BBvote1

vote2

voteN

Vote*

vote *

Vote*

CN ENCPK(3) Vote*

The people who cast

the votes decide nothing. The

people who count the vot

es decide everything

Page 88: Cryptography  for electronic voting

Misbehaving parties

• Voters: non-well formated votes; problematic for homomorphic tallying

• Mixservers: may completely replace the encrypted votes

• Tallying authorities : may lie about the decryption results

90

Page 89: Cryptography  for electronic voting

ZERO KNOWLEDGE PROOFS 91

Page 90: Cryptography  for electronic voting

Interactive proofs [GMW91]

92

w

XM1

M2

M3

Mn

Prover Verifier

X

Wants to convince the Verifier that

something is true about X. Formally that:

Rel(X,w) for some w.

Variant: the prover actually knows such a

w

Accept/Reject

Examples:

• Relg,h ((X,Y),z) iff X=gz and Y=hz

• Relg,X ((R,C),r) iff R=gr and C=Xr • Relg,X ((R,C),r) iff R=gr and C/g=Xr • Relg,X ((R,C),r) iff (R=gr and C=Xr ) or (R=gr and C/g=Xr)• RelL(X,w) iff X L

Page 91: Cryptography  for electronic voting

Properties (informal)

• Completeness: an honest prover always convinces an honest verifier of the validity of the statement

• Soundness: a dishonest prover can cheat only with small probability

• Zero knowledge: no other information is revealed

• Proof of knowledge: can extract a witness from a successful prover

93

Page 92: Cryptography  for electronic voting

Where is Waldo?

94

Page 93: Cryptography  for electronic voting

Sudoku solution

95

Page 94: Cryptography  for electronic voting

Equality of discrete logs [CP92]

• Fix group G and generators g and h• Relg,h ((X,Y),z) = 1 iff X=gz and Y=hz

• P → V: U := gr , V := hr

(where r is a random exponent)• V → P: c (where c is a random exponent)• P → V: s := r + zc ; • V checks: gs=UXc and hs=VYc

96

Page 95: Cryptography  for electronic voting

Completeness

• If X=gz and Y=hz

• P → V: U := gr , V := hr

• V → P: c • P → V s := r + zc ; • V checks: gs=UXc and hs=VYc

• Check succeeds: gs = gr+zc = grgzc = U Xc 97

Page 96: Cryptography  for electronic voting

(Special) Soundness

• From two different transcripts with the same first message can extract witness

• ((U,V),c0,s0) and ((U,V),c1,s1) such that:• gs0=UXc0 and hs0=VYc0

• gs1=UXc1 and hs1=VYc1

• Dividing: gs0-s1=Xc0-c1 and hs0-s1=Yc0-c1

• Dlogg X = (s0-s1)/(c0-c1) = Dlogh Y 98

Page 97: Cryptography  for electronic voting

(HV) zero-knowledge

99

R

c

s

Rel(X,w)

X,w X

There exists a simulator SIM that producestranscripts that are indistinguishable from those of the real execution (with an honest verifier).

R

c

s

X

Page 98: Cryptography  for electronic voting

Special zero-knowledge

100

R

c

s

Rel(X,w)

X,w X

Simulator of a special form: • pick random c• pick random s• R SIM(c,s)

R

c

s

X

Page 99: Cryptography  for electronic voting

Special zero-knowledge for CP

• Accepting transcripts: ((U,V),c,s) such that gs=UXc and hs=VYc

• Special simulator:• Select random c• Select random s• Set U= gsXc and V=hsYc

• Output ((U,V),c,s)101

Page 100: Cryptography  for electronic voting

OR-proofs [CDS95,C96]

102

R1

c1

s1

Rel1(X,w)

X,w X

R2

c2

s2

Rel2(Y,w)

Y,w Y

Design a protocol for Rel3(X,Y,w) where:Rel3(X,Y,w) iff Rel1(X,w) or Rel2(Y,w)

Page 101: Cryptography  for electronic voting

OR-proofs

103

X,Y,w

R1 R2

c1 c2

s1 s2

X,Y

c

Page 102: Cryptography  for electronic voting

OR-proofs

104

Rel1(X,w)

X,Y,w

R1 R2

c1=c-c2 c2

s1 s2

X,Y

c

Page 103: Cryptography  for electronic voting

OR-proofs

105

Rel1(X,w)

X,Y,w

R1 R2

c1=c-c2 c2

c1,s1 c2,s2

X,Y

c

To verify: check that c1+c2=c and that (R1,c1,s1) and (R2,c2,s2) are accepting transcripts for the respective relations.

Page 104: Cryptography  for electronic voting

Exercise

• (easy) Show that the OR protocol is a complete, zero-knowledge protocol with special soundness

• (easy) Design a sigma protocol to show that an exponent ElGamal ciphertext encrypts either 0 or 1.

• (medium) Design a sigma protocol to show that an exponent ElGamal ciphertext encrypts either 0, 1, or 2

106

Page 105: Cryptography  for electronic voting

Zero-knowledge for all of NP [GMW91]

107

Theorem: If secure commitment schemes exist, then there exists a zero-knowledge proof for any NP

language

Page 106: Cryptography  for electronic voting

Non-interactive proofs

108

𝝅

Prover Verifier

X,w X

Page 107: Cryptography  for electronic voting

The Fiat-Shamir/Blum transform

109

R

c

s

Rel(X,w)

X,w X

R

s

X,w X

c=H(X,R)

To verify: check (R,c,s) as before.

The proof is (R,s). To verify: compute c=H(R,s). Check (R,c,s) as before

Page 108: Cryptography  for electronic voting

Strong Fiat Shamir security

112

Theorem: If (P,V)s an honest verifier zero-knowledge Sigma protocol , FS/B() is a simulation-sound extractable non-interactive zero-knowledge proof system (in the random oracle model).

Page 109: Cryptography  for electronic voting

Three applications of NIZKPoKs

• Construction of NM-CPA schemes out of IND-CPA ones (dishonest voters)

• Proofs of correct decryption for tallying based on threshold decryption (dishonest tallies)

• Verifiable Mixnets/Shuffles (dishonest mixers)113

Page 110: Cryptography  for electronic voting

ElGamal + PoK

• Let v {0,1} and (R,C)=(gr,gvXr)• Set u=1-v

• Pick: c,s at random• Set Au= gsR-c , Set Bu=Xs (Cg-u) –c

115

Page 111: Cryptography  for electronic voting

ElGamal + PoK

• Pick Av =ga, Bv=Xa

• h H(A0,B0,A1,B1)• c’ h - c• s’ Output ((R,C), A0,B0,A1,B1,s,s’,c,c’)

116

Theorem: ElGamal+PoK as defined is NM-CPA, in the random oracle model if DDH holds in the underlying group.

Theorem: Enc2Vote(ElGamal+PoK) has vote secrecy, in the random oracle model.

Page 112: Cryptography  for electronic voting

Random oracles [BR93,CGH98]

• Unsound heuristic

• There exists schemes that are secure in the random oracle model for which any instantiation is insecure

• Efficiency vs security117

Page 113: Cryptography  for electronic voting

Exercise: Correct distributed ElGamal decryption

118

Party Pi has secret key xi, verification key : Xi = gxi

Parties share secret key: x=x1 + x2 +…+xk

Corresponding public key: X=Xi = gΣxi = gx

To decrypt (R,C): Party Pi computes: yiRxi ;

Output: C/y1y2…yk = C/Rx

(easy) Design a non interactive zero knowledge proof that Pi

behaves correctly

Page 114: Cryptography  for electronic voting

Mixnet

119

vote1

vote2

voteN

vote (2)

vote (N)

vote ( 1)

vote (1)

vote (N)

vote ( 2)

=;

Page 115: Cryptography  for electronic voting

Verifiable shuffle [KS95]

122

C1 C2 CN

D (2) D (N) D ( 1)

Ci

D (i)

E1 E2 ENE;(i)

D (i)=Ci Encpk(0;ri)

E;(i)=D(i)Encpk(0;s(i))

E;(i)=CiEncpk(0;ri+s(i))

Page 116: Cryptography  for electronic voting

Verifiable shuffle [KS95]

• Prover has C1,C2,…,Cn, D1,D2,…,Dn, permutation and random coins r1,r2,…,rn such that Di=C(i) Encpk(0;ri)

• The Prover selects a permutation , coins s1,s2,…,sn and calculates and sends to the verifier {E ;(i)=D(i) Encpk(0; s (i))}i

• The verifier selects a random bit b and sends it to the prover• The prover answers as follows

• If b=0 then it returns (;) and r1+s (1)

• If b=1 then it returns , s1,s2,…,sn

• When receiving , q1,q2,…qn the verifier checks that:• If b=0: check that E(;)(i)=Ci Encpk(0;ri) • If b=1: check that E(i)=Di Encpk(0;ri)

123

Page 117: Cryptography  for electronic voting

Exercise• (easy) The previous protocol is complete• (easy) The previous protocol has special soundness

• what is the soundness error?• What do we do about it?

• (easy) Prove zero-knowledgeness

124

Page 118: Cryptography  for electronic voting

Helios

125

Page 119: Cryptography  for electronic voting

126

P: vHelios: vote preparation

C

• C = ENCPK(v) is an encryption of the vote under a public key specific to the election

• is a proof that C encrypts a valid vote

Page 120: Cryptography  for electronic voting

BB

127

P1: v1

P2: v2

Pn: vn

Helios: voting

C1 1

C2 2

Cn n

Page 121: Cryptography  for electronic voting

BBC1 1

C2 2

Cn n

C1

C2

CN

128

Helios: Tallying

vote (2)

vote (N)

vote (1)

C

Page 122: Cryptography  for electronic voting

BB

129

Helios

C1 1

C2 2

Cn n

vote (2)

vote (N)

vote ( 1)

P1: v1

P2: v2

Pn: vn

C

Page 123: Cryptography  for electronic voting

SUMMARY 130

Page 124: Cryptography  for electronic voting

Basic primitives and models

131

Page 125: Cryptography  for electronic voting

Techniques

132

Page 126: Cryptography  for electronic voting

Schemes

133

Page 127: Cryptography  for electronic voting

BB0 BB1

Ballot secrecy for SPS

134

C0 VotePK(h0)

C

h 0,h 1

C1

C

C1 VotePK(h1)

Sees BBb

d win d=b

result rTallySK(BB0)

C0

CC

PK SK

win

b

Page 128: Cryptography  for electronic voting

Useful, desirable, difficult to get

135

Page 129: Cryptography  for electronic voting

(not) The end.

136