How Does Peggy Prove To Victor That She Still Knows Her Year of Birth, Without Revealing It?

We give away too much of our personal information on the Internet. Everytime we log into a system we are giving away some that is so…

Photo by Matthew Brodeur on Unsplash

How Does Peggy Prove To Victor That She Still Knows Her Year of Birth, Without Revealing It?

We give away too much of our personal information on the Internet. Every time we log into a system we are giving away some that is so personal to us … our password. But it doesn’t have to be like this, and we can now use a method called Zero-Knowledge Proofs (ZKPs), and where we just prove to the other side that we known something, without actually revealing what it is.

So let’s say that Victor wants Peggy to prove that she knows her year of birth. Victor could store this value as x. We will now use the Damgard Fukisaki method to prove that Peggy knows the value to Victor [here]:

In this case, Peggy will prove that she can determine the square of x to the power of g. First Victor and Peggy agree on two bases for their calculations (g and h) and a prime number (n). Victor then sends Peggy using a random number (r) as a challenge. Next Peggy creates her own random number (r1) and then calculates the following:

and then computes:

She sends c2 to Victor, and Victor checks that it equals:

If they match, Peggy has proven that she knows x. The works because:

Here is my online demo:

And here is the code:

There you go, let’s start sending zero knowledge!