Skip to main content

What is Homomorphic Encryption?

Homomorphic Encryption is a promising cryptographic technique for keeping data private. In this post I give a short a simple summary of Homomorphic Encryption including a clear definition with an example use case in cloud computing.

I assume you are already familiar with basic Encryption/Decryption and have a basic understanding of data processing.

Homomorphic Encryption has received a lot of interest recently due to the high availability of cloud computing environments. It is an area which has been researched for decades, but new breakthroughs are still being made. First I will give a basic definition:

An encryption scheme where \(E\) is an encryption function and \(D\) is a decryption function is called additively homomorphic if for any 2 inputs \(x_1, x_2\) we have \(E(x_1 )⊕ E(x_2 )=E(x_1+x_2 )\). It is multiplicatively homomorphic if \(E(x_1 )⊗ E(x_2 )=E(x_1×x_2 )\). Here the symbols \(⊕\) and \(⊗\) just mean there is some fixed algorithm you can perform to achieve the equalities with any inputs. An encryption scheme is called fully homomorphic if it is both additively and multiplicatively homomorphic.

To give you some examples, the RSA and Elgamal cryptosystems are multiplicatively homomorphic, and the Paillier cryptosystem is additively homomorphic.

In 1978 the question was asked whether a fully homomorphic encryption scheme actually exists, but it took until 2009 for the first one to be found. It was found by the computer scientist Craig Gentry, who has since made many more breakthroughs in the area.

Now I will explain how this can be applied to a real world problem:

Suppose a company is collecting some data and they want to process the data, but they don’t have enough computing power or time available. Over the last decade cloud technology has become the most common solution to this problem. Large tech companies like Amazon, Microsoft or Google provide cloud services where you can rent as much computing power as you need.

But, this has its drawbacks. It introduces a big problem with data privacy since transferring the data to a cloud service provider is effectively giving it to a 3rd party. With new data regulations like GDPR this might not be an option legally (or morally) for the data collector.

Luckily, most data processing only requires simple operations like addition and multiplication applied a large number of times. Therefore fully homomorphic encryption provides a solution to this problem. Before sending the data to the cloud service, the data can be encrypted by the client, i.e. they send data in the form \((E(x_1 ),E(x_2 ),…,E(x_n ))\). This means the cloud service provider cannot extract information from the encrypted data as it looks almost random so the client is not breaking any rules or laws. Then the cloud service can apply the \(⊕\) and \(⊗\) operations to the data, in the place of addition and multiplication to obtain for example:
$$(E(x_1 )⊕ E(x_2 ))⊗ E(x_3 )=E((x_1+x_2)×x_3 )$$
The result still looks random, but when sent back to the client it can be decrypted to give the correct answer, \(D(E((x_1+x_2 )×x_3 ))=(x_1+x_2 )×x_3\).

In fact, the client doesn’t even need to store the data themselves before sending it. Rather than using a local database, they could use a remote database in the cloud where the data can be stored in an encrypted form to make the process even more efficient.

The encryption and decryption functions are usually easy to compute so the client doesn’t need much processing power. Some cloud service providers have already released libraries for this. For example, take a look at Microsoft's SEAL library, released in December 2018.

However there are still improvements to be made. For the cloud service the operations \(⊕\) and \(⊗\) are much harder to compute than regular addition and multiplication. In many cases, cloud services can still provide enough computing power to handle this. But improving these time complexities is a big area of active research.

Homomorphic encryption also suites a range of other use cases. For example, it is the basis of many Secure Multiparty Computation protocols, and it could also be combined with Trusted Execution Environments like Intel SGX.

Data privacy is becoming increasingly important as data is being collected and shared on a huge scale. Privacy preserving techniques like homomorphic encryption might not solve this problem entirely, but in many cases they can form a large part of the solution.

I plan on releasing some posts in the future on similar topics, so please subscribe if you are interested.

Comments

Post a Comment

Popular posts from this blog

Terminals in Sublime Text 3

If you need a quick answer on how to create terminals in Sublime Text 3, watch the following video, or read the instructions below it. How to set up Terminals in Sublime Text 3 Open Sublime Text. Open the Command Palette with Crtl+Shift+P Type  'Package Control: Install Package' until the option appears and select it [You'll need to install package control if you are using it for the first time] Type 'Terminus' and select it. Now the package Terminus will install. Wait for this to complete. Then restart Sublime Text. Next we will add Commands to the Command Palette. So you can open terminals using Crtl+Shift+P then typing a command. To do this open the Command Palette (Ctrl+Shift+P) and type 'Terminus: Command Palette' and open it. You'll be greeted by a split view. Basically there are settings defined in the code on the left panel and you can override them or add your own by typing code in the right panel. Copy ...

Generating a MSI Installer for a WPF Application

This post serves as a tutorial for creating a MSI installer for your WPF Applications in Visual Studio. For this we use WiX (recommended by Microsoft). Prerequisites I assume you already have a Visual Studio solution containing a WPF Project. And I assume you have some experience with Visual Studio and XML. You do not need any prior knowledge of WiX. Step 1: Install Wix We are going to need WiX to generate our MSI. If you don't already have Wix installed, go ahead and download it from here . You'll be redirected to the relevant GitHub releases page where you can download the .exe file to install WiX.

Fill your GitHub activity heatmap with the image of your choice

Taking 12 months to upload a 52x7 pixel image, through thousands of git commits, ... that's completely reasonable right?