Homomorphic Encryption using ElGamal Encryption

--

There are some encryption methods which allow us to process encrypted values. In this way we can process using certain mathematical operations on cipher values, and end up with the result when we decrypt. For example, if we encrypt a value of 4 and a value of 3 with a public key we get:

Epub(4), Epub(3)

If we now multiply these values we get:

Res=Epub(4)xEpub(3)

If we now decrypt the result (Res) with the private key, and the answer is 12, we have performed a multiplication on the encrypted values. RSA is one method that we can perform a multiplication and division — and is defined as a partial homomorphic encryption (PHE) method. Another method we can use to multiply and divide is ElGamal. If you are interested, here is the method [here]:

Basically, we compute the cipher values (a,b) for both integer values, and then multiply the a values and multiply the b values. The decryption process is then just the same as with a single value. The Go code for this is [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.