BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News IBM Fully Homomorphic Encryption Toolkit Now Available for MacOS and iOS

IBM Fully Homomorphic Encryption Toolkit Now Available for MacOS and iOS

This item in japanese

Bookmarks

IBM's Fully Homomorphic Encryption (FHE) Toolkit aims to allow developers to start using FHE in their solutions. According to IBM, FHE can have a dramatic impact on data security and privacy in highly regulated industries by enabling computing directly on encrypted data.

Broadly classifiable within the same arena as secure multi-party computation, Homomorphic Encryption is an approach to secure computation that does not require decrypting your data in order to process them. Instead, homomorphic encryption enables processing ciphertexts with the guarantee that encrypted results match those that would be produced by first decrypting input data, processing them, and finally encrypting them.

Homomorphic Encryption (HE) can be partially homomorphic, somewhat homomorphic, leveled fully homomorphic, or fully homomorphic, depending on the number and kind of allowed primitive operations. For example, partially homomorphic encryption only uses one type of operation, either addition or multiplication, that can be applied an unlimited number of times to the ciphertexts. The commonly used RSA algorithm is a kind of partially homomorphic encryption. Somewhat homomorphic encryption may use one kind of operation, just like partially homomorphic, but it can only be performed a limited number of times. Fully homomorphic encryption, instead, enables using both addition and multiplication an unlimited number of times.

According to IBM researcher Flavio Bergamaschi, FHE is well suited to industries with strict regulations, such as finance and healthcare.

IBM Fully Homomorphic Encryption Toolkit is based on HELib, an open source HE library providing a number of low-level routines such set, add, multiply, shift, and others, along with higher-level features for automatic noise management, multi-threading, and so on.

IBM Research helped pioneer FHE in 2009 with the creation of HeLib, which has grown to become the world’s most mature and versatile encryption library. Since then, we have made significant strides in performance, achieving over a 100x improvement in speed that allows FHE to be leveraged in the applications we rely on in our everyday lives.

Homomorphic encryption requires a specific skill-set for programmers and IBM HFE Toolkit aims to make it easier for them to start using this technology.

It was no small feat to synthesize 11 years of top-notch cryptography research into a streamlined developer experience that is accessible and freely available to anyone in the time most people would spend to brew a pot of coffee or de-clutter a desk.

As mentioned, IBM initial release supports macOS and iOS, with Linux and Android coming soon. The toolkit provides a ready-to-use playground including a sample app that perform a query on an encrypted database. The query takes about 80 seconds on a MacBook Pro and the relevant code is shown below:

     /************ Perform the database search ************/

     dispatch_async(dispatch_get_main_queue(), ^(void){
        [self.logging setStringValue:[NSString stringWithFormat:@"Searching the Database"]];
     });
     FHE_NTIMER_START(Query_search);
     std::vector<helib::Ctxt> mask;
     mask.reserve(address_book.size());
     for (const auto& encrypted_pair : encrypted_address_book) {
       helib::Ctxt mask_entry = encrypted_pair.first; // Copy of database key
       mask_entry -= query;                           // Calculate the difference
       mask_entry.power(p - 1);                       // FLT
       mask_entry.negate();                           // Negate the ciphertext
       mask_entry.addConstant(NTL::ZZX(1));           // 1 - mask = 0 or 1
       // Create a vector of copies of the mask
       std::vector<helib::Ctxt> rotated_masks(ea.size(), mask_entry);
       for (int i = 1; i < rotated_masks.size(); i++)
         ea.rotate(rotated_masks[i], i);             // Rotate each of the masks
       totalProduct(mask_entry, rotated_masks);      // Multiply each of the masks
       mask_entry.multiplyBy(encrypted_pair.second); // multiply mask with values
       mask.push_back(mask_entry);
     }

    // Aggregate the results into a single ciphertext
    // Note: This code is for educational purposes and thus we try to refrain
    // from using the STL and do not use std::accumulate
    helib::Ctxt value = mask[0];
    for (int i = 1; i < mask.size(); i++)
        value += mask[i];

    FHE_NTIMER_STOP(Query_search);

Homomorphic encryption is still a rather young field which attracts lots of research efforts. IBM is not the only company investing on homomorphic encryption. Microsoft, for instance, released SEAL (Simple Encrypted Arithmetic Library), and Google recently unveiled its Private Join and Compute tool.

Rate this Article

Adoption
Style

BT