prinsight is a C++ library, aims to provide easy-to-use APIs to build privacy preserving applications utilizing multi-client and decentralized functional encryption techniques. Also all necessary data security batteries are part of SDK. The cryptographic primitives are based on Decentralized Multi-Client Functional Encryption for Inner Product paper by Chotard et al., 2017. A big thanks to authors of CiFEr library who has provided C-implementation of aforementioned paper. prinsight SDK uses CiFEr library.
Using prinsight SDK, we can build applications where users can share their data in encrypted form along with a shared functional decryption key to a analytics server and server can learn inner-product analysis(such as weighted sum) without accessing data in clear form. The generation of shared functional decryption key can be completely peer-to-peer decentralized way or coordinated by a server.
-
prinsight SDK depends on: CiFEr, libgmp, libsodium, amcl, spdlog, base64, and nlohmann_json.
-
Test dependency: doctest.
-
Example applications depends on: pistache, curl, RESTinCurl, and cxxopts.
- include - Header files for prinsight SDK
- source - prinsight SDK
- client - an example REST client app using prinsight SDK
- server - an example REST server app using prinsight SDK
The project is developed on Ubuntu 20.04 machine with usual build-essential package, CMake and C/C++11 tool chain.
There is sample client and server application where 2 clients send their encrypted data and functional decryption key to server and server learns the sum of their data without accessing their individual clear data.
- Clone the repo
git clone https://github.com/dfbydx-com/prinsight.git
- In the root directory of local repository, build and install CiFEr library and its dependencies first,
cd build-scripts ./build-linux64.sh
- In the root directory of local repository, build data owner client app,
cmake -Hclient -Bout/build/client cmake --build out/build/client
- In the root directory of local repository, build coordinating server app,
cmake -Hserver -Bout/build/server cmake --build out/build/server
- Open 2 shell prompts and run below commands in each shell to execute 2 client apps,
./out/build/client/piclient
- Open another shell prompt and run below commands for executing server app,
./out/build/server/piserver
- Now in another shell prompt, use curl to fetch result,
If everything is fine, then above curl command returns following string,
curl http://localhost:9080/analysis
[["label1",2],["label2",10]]
Build and run the test cases,
cmake -Htest -Bout/build/test
cmake --build out/build/test
./out/build/test/prinsightTests
Work in progress.
Features
- TLS support
- Android build
- Dart FFI
Code quality and automation
- Improve logging
- Unit and integration test cases
- Code analysis and fuzzing
- Documentation
- CI setup
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
As of now, this project is in very early stage and serves mainly proof-of-concepts, benchmarking and evaluation purpose and not for production use. Also implementation have not been fully-reviewed.
Distributed under the Apache License. See LICENSE
for more information.
We have used this awesome ModernCPPStarter template for this project.