Photo by Sahand Hoseini on Unsplash

How Does Peggy Prove To Victor The Banker That Her Salary is between $30K and $100K Without Revealing It?

And the greatness of Python 3.8

--

Python is wonderful, and it just keeps getting better. One of the new changes in Python 3.8 is the support for:

pow(a,b,p)

and where b can now be a negative number. This is a great advancement for crypto functions, as we often have to use the inverse mod function to perform a divide. With the new function, Python 3.8 does it all automatically, and so: [a/b] can now become [a * pow(b,-1,p)]. Magic! And so in this article, I’ll use this new function, and run the code in Python 3.8

Home on the range

There are many things in life ask if we have something that is in a certain range, such as for our age, our salary or even our weight. But when we answer the question we often have to give away the actual value. So how can we take our value, and show someone that the range is in a certain range? Well for this we can use range proofs.

So let’s say that Victor wants Peggy to prove that her salary is between $30K and $100K. We will now use the Damgard Fukisaki method to prove that Peggy’s salary is in a given range [here]:

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.