Member-only story
Solving Quadratic Equations With Homomorphic Encryption
Homomorphic encryption provides us with a way to process encrypted data, and where we can create a key pair and use the public key to encrypt the data, and then — after homomorphic processing — the result can be decrypted with the associated private key:
In this article, we will use many of the key elements of using the OpenFHE library, such as for basic evaluation functions (Add, Subtract and Multiply), using math functions (such as a square root function), and in using the divide operation. Overall, for x divided by y, we will invert y (with 1/y), and then multiply this value by x. The square root function will be implemented using a Chebyshev approximation method.
With CKKS, we can perform mathematical operations with homomorphic encryption using floating-point values. In this case, we will solve ax²+bx+c and for b²>4ac. The solution is:
If we try, x²−2x−3, we get:
This gives x=3 and x=−1 as the solutions.
In this case, we will encrypt the values of a, b and c. Initially, we encrypted the input floating point values:
Plaintext a_plaintext =…