Skip to content

zama-ai/fhe_ios_demo

Repository files navigation

Zama Concrete ML iOS Demos


📒 Documentation | 💛 Community support | 📚 FHE resources by Zama

About

What is Concrete ML iOS Demos?

This repository contains iOS applications that demonstrate how FHE can help users securely get insights based on their personal data. The applications in this repository run on iPhones and connect to remote services that work with encrypted data. These services are implemented with Concrete ML.

Concrete ML is a Privacy-Preserving Machine Learning (PPML) open-source set of tools built by Zama. It simplifies the use of Fully Homomorphic Encryption (FHE) for data scientists so that they can automatically turn machine learning models into their homomorphic equivalents, and use them without knowledge of cryptography.

Main features

The repository implements the Data Vault and several end-user demo applications. Data Vault is the main storage of sensitive information and two example apps that use sensitive data encrypted by the Data Vault.

The Data Vault acts like a secure enclave: it encrypts sensitive user data (sleep, weight, profile info) and stores encrypted result in a shared folder for consumption by other apps. Human readable sensitive data never leaves device or the Data Vault app.

To display the insights or results obtained from encrypted data, end-user applications must request that Data Vault displays the information in secure widgets.

The following demo end-user applications are available:

  1. FHE Health: Analyzes sleep quality data and provides statistics about the user's weight, producing graphs and insights. The sleep tracking can be done by an iWatch using the dedicated Sleep App.
  2. FHE Ads: Displays targeted ads based on an encrypted user-profile. Internet advertising relies on behavioral profiling through cookies, but tracking user behavior without encryption has privacy risks. With FHE, a user can manually create their profile and ads can be matched to it without actually exposing the user-profile.

For these demo end-user applications, analysis and processing of the encrypted information is done on Zama's servers. Server side functionality for these end-user applications is implemented in the Server directory.

The Data Vault uses TFHE-rs and Concrete ML Extensions to encrypt and decrypt data.

Setup

Install Apple Tools

Install AdImages

  • Simply unzip `QLAdsExtension/AdImages.zip' in place.

Compiling app dependencies for iOS and Mac simulator

Building libraries

The easiest way to build all dependencies is to execute the dedicated script.

To manually build the libraries follow the instructions in the compilation guide. The main steps are:

  1. Install Rust
  2. Compile TFHE-rs
  3. Compile Concrete ML Extensions

Using pre-built TFHE-rs libraries

Instead of building the TFHE.xcframework from scratch, you can use a previously built version. Simply save TFHE.xcframework in the root directory. Inside this framework, there should be:

  • Info.plist
  • ios-arm64
  • ios-arm64-simulator

Data Vault and end-user application compilation

Now you can open your Xcode IDE, open this directory and start building the apps.

End-user Application Server

This repo also contains the backend implementations of the end-user applications. See the server readme for more details on how to run these backends.

Resources

License

This software is distributed under the BSD-3-Clause-Clear license. Read this for more details.

FAQ

Is Zama’s technology free to use?

Zama’s libraries are free to use under the BSD 3-Clause Clear license only for development, research, prototyping, and experimentation purposes. However, for any commercial use of Zama's open source code, companies must purchase Zama’s commercial patent license.

All our work is open source and we strive for full transparency about Zama's IP strategy. To know more about what this means for Zama product users, read about how we monetize our open source products in this blog post.

What do I need to do if I want to use Zama’s technology for commercial purposes?

To commercially use Zama’s technology you need to be granted Zama’s patent license. Please contact us at [email protected] for more information.

Do you file IP on your technology?

Yes, all of Zama’s technologies are patented.

Can you customize a solution for my specific use case?

We are open to collaborating and advancing the FHE space with our partners. If you have specific needs, please email us at [email protected].

↑ Back to top

Support

Support

🌟 If you find this project helpful or interesting, please consider giving it a star on GitHub! Your support helps to grow the community and motivates further development.

About

Implement a bridge iOS app, which simulate a new FHE app store which runs on encrypted data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6