ZK Auth
Sam Goto
    
    - Dan Boneth's Discrete Log based Zero-Knowledge Proof
- diffie hellman assumption: inverting discrete logarithms is hard
- y = g ^ x mod p
- If I give you y(and we have a pre-agreement ongandp), I'd like to prove to you that I knowxwithout givingxto you *So, how do I prove that I knowxwithout giving `x to you?
- zero knowledge proof
- first, I'll generate random integer r
- then, I'll calculate C = g ^ r mod p
- I'll send you, the verifier, C
- The verifier asks for x + r?
- I'll calculate w = x + r mod (p - 1)
- I'll send you w
- Using Candw(as well asg,pandy), the verifier can tell that you know `x- Because a ^ x * a ^ y = a ^ (x + y)and
- a ^ x mod p = a ^ (x mod (p - 1)) mod p(Fermat's Little Theorem)
- y * C mod p=- (g ^ x mod p) * (g ^ r mod p) * mod p=- g ^ x * x ^ r mod p=- g ^ (x + r mod (p - 1)) mod p=- g ^ w mod p
 
- Because 
- I'll verify that y * C mod p=?g ^ w mod p
- But:
- I could have choosen a random zsuch that
- C = g ^ z / y mod pand when you ask for- wI'll send you:
- w = z
- Which you'd use to calculate y * C mod p=?g ^ w mod pand I'd trick you because:
- y * C mod p=- y * (g ^ z / y) mod p=- g ^ z mod pwhich would match
- To check that you used a random r, the verifier would ask for it
- Such that it could verify that Cwas computed such that it matchesg ^ r mod p
- But if the verifier asks for both x + randrthen it can derivex
 
- I could have choosen a random 
- The trick is for the verifier not to ask for x + randrbut to randomly ask for one of the two- If the verifier randomly picks r, then it can check if the prover lied by testing ifC = g ^ r mod p
- If the verifier randomly picks x + r, then it can check if you knowxby checking ify * C mod p=?g ^ w mod p
- If the prover is trying to fool the verifier, it needs to prepare and commit to yandC:- if the prover generates C = g ^ r mod pthen it can't know how to preparew = x + r mod (p - 1)because it doesn't knowxsoy * C mod pwon't matchg ^ w mod p
- if the provder generates C = g ^ z / ythen it can't providerbecauseC = g ^ r mod pwon't match theCthat was given before
 
- if the prover generates 
 
- If the verifier randomly picks 
 
- first, I'll generate random integer