Homomorphic Encryption Basics

5ireChain
3 min readMay 4, 2022

What is Homomorphic Encryption, really?

Homomorphic encryption (HE) is an encryption scheme that can resolve current security and privacy issues. Classic public-key encryption schemes used in the majority of crypto projects have three security procedures: key generation, data encryption using the key, and data decryption using the key. HE, on the other hand, uses four procedures; the three steps used in classic public-key encryption above plus an evaluation algorithm as shown in the figure below. The beauty of HE lies in the fact that it allows third-party service providers to perform specific operations on users’ encrypted data without decrypting the data while simultaneously maintaining the privacy of the users’ encrypted data.

In HE, if a user wants to query certain information on the cloud server, they first encrypt their data and store the encrypted data in the cloud. Then, after some time, when the user sends a query to the cloud server, the cloud server runs a prediction algorithm on the encrypted data using HE — the server does all this without knowing the contents of the encrypted data. In response, the cloud returns the encrypted prediction back to the user and the user decrypts the received encrypted data using their secret key, all done while preserving the privacy of their data. At no point does the data travel to and fro in a decrypted form nor does it get decrypted by the server.

It’s in the math.

The magic in HE occurs in math. The mathematical operation on the plaintext during encryption is equivalent to the other operation performed on the ciphertext. Hence the term homomorphic encryption. Consider a simple homomorphic operation on the plaintext with the corresponding ciphertext operation in the figure below:

  1. User encrypts message m, Enc(m)
  2. The user sends Enc(m) to store
  3. User queries, f()
  4. The server evaluates f() homomorphically
  5. Server returns Enc(f(m))
  6. User computes Dec(Enc(f(m)) and recovers f(m)

In short, homomorphisms provide the means to transfer and process data without decryption, because the algorithm relates algebraic objects with a shared process.

An example of a cloud application using HE is illustrated in the next figure. In this scenario, the client encrypts their private data m using the function Enc(m), then sends the encrypted data to the cloud server. When the client wants to perform a function (i.e., query), f(), on their data, they send the function to the server. The server performs evaluates the encrypted data homomorphically. That is, the server computes f() blindfolded and returns the encrypted result to the client. Finally, the client recovers the data with their secret key and obtains f(m).

  1. User C encrypts message m, ENC(m)
  2. C sends Enc(m) to store S
  3. C queries f()
  4. S evaluates f() homomorphically
  5. S returns Enc(f(m)
  6. C computers Dec(Enc(f(m))) = f(m), and recovers f(m)

There are three types of HE schemes based on the number of operations permitted on the encrypted data. The types are as follows: (1) Partially Homomorphic Encryption (PHE); (2) Somewhat Homomorphic Encryption (SWHE); and (3) Fully Homomorphic Encryption (FHE). PHE permits only one sort of procedure to be performed an infinite number of times, SWHE allows for a restricted number of procedures, and FHE permits an infinite number of procedures to be performed an infinite number of times.

HE allows a third party (e.g., cloud, service provider) to perform certain computable functions on the encrypted data while preserving the features of the function and format of the encrypted data. This homomorphic encryption corresponds to a mapping in abstract algebra and takes advantage of the ability of a shared function to hide the content of encrypted data.

More information about 5ireChain can be found by clicking on the following links:

Website: https://5ire.org

White paper: https://bit.ly/3Qcsmor

LinkedIn: https://www.linkedin.com/company/5ireChain

Twitter: https://twitter.com/5irechain

Discord: http://discord.gg/5ire

Telegram: https://t.me/OfficialFireChain

--

--

5ireChain

5ireChain — www.5ire.org | Layer-1 EVM Compatible Smart Contract Platform | In Consensus Sustainability