IBM's homomorphic encryption accelerated to run 75 times faster

It lets you work on encrypted data without taking it to plaintext and back again

By Richard Chirgwin


IBM has rewritten its C++ homomorphic encryption library and claims it now goes up to 75 times faster.

Homomorphic encryption is a technique used to operate on encrypted data without decrypting it. This would make sensitive operations much more secure: for example, companies could encrypt their cloud-hosted databases, and work on them without converting records back to plaintext.

IBM has worked on homomorphic encryption for some time, and released the first version of its HElib C++ library three years ago, but as we reported in 2016, the technology has always suffered huge performance penalties.

IBM's first attempts at homomorphic encryption, under the hand of its inventor Craig Gentry, ran “100 trillion times” slower than plaintext operations. It later accelerated by a factor of two million times, running on a 16-core server.

Microsoft researchers smash homomorphic encryption speed barrier


Hence Big Blue's ongoing work on HElib. Released at GitHub, the latest version gets its performance kick from a “re-implementation of homomorphic linear transformations”, making it between 15 and 75 times faster.

In this paper at the International Association for Cryptologic Research, IBM's Shai Halevi and Victor Shoup (the latter also with New York University) explain how they improved speed.

“In the linear transformation algorithms currently implemented in HElib, the bulk of the time is spent moving data among the slots in the encrypted vector,” they wrote.

This is done with “special automorphisms” (a mathematical operation that maps an object to itself), and the computational cost comes from how many times the automorphisms have to loop around.

“The main cost of applying such an automorphism to a ciphertext is actually that of “key switching”: after applying the automorphism to each ring element in the ciphertext (which is actually a very cheap operation), we end up with an encryption relative to the “wrong” secret key; by using data in the public key specific to this particular automorphism — a so-called “key switching matrix” — we can convert the ciphertext back to one that is an encryption relative to the “right” secret key” the paper said.

“So the main goals in improving performance are to reduce the number of automorphisms, and to reduce the cost of each automorphism.”

In more accessible English, the new library implements a new strategy for calculating those automorphisms (achieving between 15 and 20 times speedup); the researchers refactored many of the necessary computations; and some of the calculations are shifted out of the library's main loop (getting a 6-8 times speedup).

The way public keys are constructed for homomorphic encryption is also expensive because of the aforementioned key-switching matrix. Each matrix adds several megabytes to the public key, and in HElib there could be several hundred such matrices in a public key. The researchers say for common operations, they were able to cut the size of the matrix by 33-50 per cent.

HElib is still a research-level project. As stated on the GitHub page: “At its present state, this library is mostly meant for researchers working on HE and its uses. Also currently it is fairly low-level, and is best thought of as 'assembly language for HE'. That is, it provides low-level routines (set, add, multiply, shift, etc.), with as much access to optimisations as we can give. Hopefully in time we will be able to provide higher-level routines.” ®

Sign up to our NewsletterGet IT in your inbox daily


More from The Register

Boffin: Dump hardware number generators for encryption and instead look within

Chip timing could be as effective and harder to hack

Raspberry Pi foundation merges with CoderDojo Foundation

Two coding-for-kids orgs already overlapped, now plan joint acceleration

Bill Gates declined offer to serve as Donald Trump's science advisor

Spontaneous offer made during chat about vaccines (which - phew! - Trump seemed to like)

Ozzie Ozzie Ozzie, oi oi oi! Tech zillionaire Ray's backdoor crypto for the Feds is Clipper chip v2

Analysis Lotus Notes man has a plan... and a patent

Curiosity's computer silent on science, baffling boffins

Robot is 'responsive' but for some reason it can't transmit science data

Arecibo spared the axe: Iconic observatory vital to science lives on

NSF approves plan to keep Puerto Rico facility operational after hurricane trashed it

China's loose Chang'e: Probe lands on far side of the Moon in science first, says state media

Chang'e 4 makes history with 'soft landing' on lunar surface

It could be you: National Lottery hands £16m to England's Jodrell Bank

Iconic site bags funding for 'astronomy gallery'

GCSE computer science should be exam only, says Ofqual

Oh, and some exam boards might need to offer paper-based tests due to schools' crap IT kit

Here's a search engine for all you boffins and eggheads that makes it easier to learn science

Microsoft co-founder's gift from beyond the grave