Intro To Homomorphic Encryption

Korra Pickell
Artificialis
Published in
3 min readFeb 26, 2022

Privacy will forever be at the center of discussions regarding technology, commerce, and industry. With the rise of Big Data, Machine Learning, and Cloud Computing over the past decade, it has become increasingly important to ensure our data and personal information is kept private to us and those we trust.

Machine learning and statistical analysis requires large amounts of — in some cases — very personal data. Asking individuals to voluntarily hand over that data, and then storing all that information in the same place, carries heavy risks for breaches in privacy.

The widely regarded solution to this problem is Homomorphic Encryption (HE). HE is a form of encryption that allows for mathematical computations directly on encrypted data. In practice, this means we can train, test, and deploy machine learning models — or perform any other valuable service — against fully encrypted data that remains private during the entire process. This way, individuals can still receive online services without having to offer up their private data.

A major application for HE is in Federated Learning schemes. Federated learning is a version of machine learning that takes place on a network of nodes, instead of just one singular central machine. Each node is responsible for training a model on it’s own data, and the models are then combined into a global model by a designated central node.

This already comes with its advantages, as the data associated with each node of the network stays private to that node, and is not shared with any other node. Instead, only the model itself is shared to a central node for computationally expensive back-propagation and weight updates.
To further ensure privacy, we can use Homomorphic Encryption for all model training mathematics, so that even the models themselves stays fully encrypted while they’re being processed on the central node.

The Drawbacks

While HE provides a solution to our privacy problem, it is still far from mainstream.

Homomorphic Encryption is extremely expensive from a computational standpoint. It requires heavy overhead to maintain, which is why it is typically only used in circumstances where the concern for privacy comes before expense. Examples of this are in the finance, healthcare, and cybersecurity sectors.

Currently, HE computations can be millions of times more difficult to process than the same corresponding plaintext operations.

Types of Homomorphic Encryption

  • Partial HE: a limited form of HE that allows for an unlimited number of mathematical computations of a single kind on a given piece of encrypted data. This typically means addition, multiplication, or some other basic singular function.
  • Almost HE: a transitional type of HE between Partial and Full HE. Allows for a finite number of computations of several different types on a piece of encrypted data. This could mean a combination of ten different consecutive operations ranging from addition and subtraction to multiplication and division.
  • Full HE: allows for an infinite number of arbitrary computations (any kind of computation). This is the ultimate goal of Homomorphic encryption, but is consequentially the most computationally expensive to perform.

A Brief Technical Example

  1. Alice writes an academic paper and wants to use an online service that will make sure the grammar is correct
  2. Alice, using a private key she has generated, encrypts her paper and sends it to the online service
  3. Using a Homomorphic Encryption scheme (one that is standardized and agreed upon by both Alice and the service), the online service is able to check Alice’s paper for grammatical errors without having to decrypt it in any way
  4. After the operations are performed on Alice’s paper by the service, the resulting output is already in an encrypted state, and is promptly sent back to Alice
  5. Alice is able to use the same private key she originally used to encrypt her paper to decrypt the grammatically correct one returned by the online service

In this scenario, Alice was able to access a service without having to give up her private data. Alice did not have to trust this service in any way.

When it is written out like this, it is easy to see why the tech world has such high hopes for Homomorphic Encryption in the future, and why it is likely to become the modus operandi of the computing world.

--

--

Korra Pickell
Artificialis

Hello! I am Korra, an open source machine learning engineer. Follow along with me as I explain complicated deep learning topics in an easy to understand way.