All Projects → bogdan-kulynych → libshe

bogdan-kulynych / libshe

Licence: GPL-3.0 license
Symmetric somewhat homomorphic encryption library based on DGHV

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to libshe

elgamalext
Extension for the .NET Framework cryptography subsystem, which introduces the ElGamal public key cryptosystem with support for homomorphic multiplication.
Stars: ✭ 14 (-41.67%)
Mutual labels:  homomorphic-encryption, homomorphic-encryption-library
concrete
Concrete ecosystem is a set of crates that implements Zama's variant of TFHE. In a nutshell, fully homomorphic encryption (FHE), allows you to perform computations over encrypted data, allowing you to implement Zero Trust services.
Stars: ✭ 575 (+2295.83%)
Mutual labels:  homomorphic-encryption, homomorphic-encryption-library
awesome-secure-computation
Awesome list for cryptographic secure computation paper. This repo includes *Lattice*, *DifferentialPrivacy*, *MPC* and also a comprehensive summary for top conferences.
Stars: ✭ 125 (+420.83%)
Mutual labels:  homomorphic-encryption
gomorph
Implementing Homomorphic Encryption in Golang 🌱
Stars: ✭ 76 (+216.67%)
Mutual labels:  homomorphic-encryption
WeDPR-Lab-Android-SDK
Android SDK of WeDPR-Lab-Core; WeDPR即时可用场景式隐私保护高效解决方案核心算法组件Android SDK
Stars: ✭ 14 (-41.67%)
Mutual labels:  homomorphic-encryption
fully-homomorphic-encryption
Libraries and tools to perform fully homomorphic encryption operations on an encrypted data set.
Stars: ✭ 2,737 (+11304.17%)
Mutual labels:  homomorphic-encryption
concrete-numpy
Concrete Numpy is a python package that contains the tools data scientists need to compile various numpy functions into their Fully Homomorphic Encryption (FHE) equivalents. Concrete Numpy goes on top of the Concrete Library and its Compiler.
Stars: ✭ 111 (+362.5%)
Mutual labels:  homomorphic-encryption
he-toolkit
The Intel Homomorphic Encryption (HE) toolkit is the primordial vehicle for the continuous distribution of the Intel HE technological innovation to users. The toolkit has been designed with usability in mind and to make it easier for users to evaluate and deploy homomorphic encryption technology on the Intel platforms.
Stars: ✭ 40 (+66.67%)
Mutual labels:  homomorphic-encryption
ecelgamal
Additive homomorphic EC-ElGamal
Stars: ✭ 19 (-20.83%)
Mutual labels:  homomorphic-encryption
federated-learning-poc
Proof of Concept of a Federated Learning framework that maintains the privacy of the participants involved.
Stars: ✭ 13 (-45.83%)
Mutual labels:  homomorphic-encryption
rust-paillier
A pure-Rust implementation of the Paillier encryption scheme
Stars: ✭ 78 (+225%)
Mutual labels:  homomorphic-encryption
minionn
Privacy -preserving Neural Networks
Stars: ✭ 58 (+141.67%)
Mutual labels:  homomorphic-encryption
encrypted-geofence
testing out homomorphic encryption
Stars: ✭ 33 (+37.5%)
Mutual labels:  homomorphic-encryption
haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
Stars: ✭ 96 (+300%)
Mutual labels:  homomorphic-encryption
WeDPR-Lab-Java-SDK
Java SDK of WeDPR-Lab-Core; WeDPR即时可用场景式隐私保护高效解决方案核心算法组件通用Java SDK
Stars: ✭ 18 (-25%)
Mutual labels:  homomorphic-encryption
WeDPR-Lab-Core
Core libraries of WeDPR instant scenario-focused solutions for privacy-inspired business; WeDPR即时可用场景式隐私保护高效解决方案核心算法组件
Stars: ✭ 147 (+512.5%)
Mutual labels:  homomorphic-encryption
WeDPR-Lab-iOS-SDK
iOS SDK of WeDPR-Lab-Core; WeDPR即时可用场景式隐私保护高效解决方案核心算法组件iOS SDK
Stars: ✭ 13 (-45.83%)
Mutual labels:  homomorphic-encryption
node-seal
Homomorphic Encryption for TypeScript or JavaScript - Microsoft SEAL
Stars: ✭ 139 (+479.17%)
Mutual labels:  homomorphic-encryption
Seal
Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
Stars: ✭ 2,424 (+10000%)
Mutual labels:  homomorphic-encryption
threshold-signatures
Threshold Signature Scheme for ECDSA
Stars: ✭ 79 (+229.17%)
Mutual labels:  homomorphic-encryption

libshe

Build Status Coverage Status

Symmetric somewhat homomorphic encryption library based on DGHV scheme.

Introduction

Homomorphic encryption is a kind of encryption that allows to execute functions over the ciphertexts without decrypting them. This library implements a symmetric variant of originally asymmetric somewhat homomorphic encryption scheme over the integers by van Dijk et al. DGHV10 using ciphertext compression techniques from CNT11. The symmetricity of the scheme means that only the private key is used to encrypt and decrypt ciphertexts. A relatively small public element, however, is used in homomorphic operations, but it is not a real public key.

Such scheme is useful in secure function evaluation setting, where a client encrypts an input to an algorithm using their private key, sends it to a server which executes an algorithm homorphically, and sends the output back to the client. The client then obtains the output of the algorithm by decrypting server response using the private key.

See the following diagram for visual explanation.

  • Let f be an algorithm to be evaluated on a server.
  • Let a[1], a[2], ... a[n] be inputs of f that client provides to the server.
  • Let b[1], b[2], ... b[n] be inputs of f that server possesses.
  • Let p be the client's private key, and x[0] be the corresponding public element

SFE

Status

Warning. This is experimental software. It is not to be used in mission-critical applications. Since the time this software was written, parameters of the underlying scheme were broken many times.

Installation

You can consult the .travis.yml for concrete installation commands on Debian-based systems.

Requirements

  • gcc >= 4.8
  • boost >= 1.55
  • GMP >= 6.0.0
  • lcov >= 1.11 (optional)

Building and installation

Build and install libshe.so library and headers:

make
sudo make install

You can also uninstall with

sudo make uninstall

Usage

Tests and benchmarks

Run tests:

make tests

Note. Running tests will compile sources with debug options. Do make clean before installing if tests were run previously.

Run benchmarks:

make benchmarks

Building your program

Use C++11 and link against GMP and Boost Serialization when building your program:

-std=c++11 -lgmp -lboost_serialization -lshe

Include libshe in your sources:

#include <she.hpp>

using she::ParameterSet;
using she::PrivateKey;
// ...

Example

The following example assumes a client and a server that are engaged in a two-party secure function evaluation protocol.

Client generates a parameter set:

const ParameterSet params = ParameterSet::generate_parameter_set(62, 1, 42);

Given these parameters, the encryption scheme exhibits following properties:

  • Security level is (62-bit)
  • At least 1 multiplication can be evaluated on every bit in the ciphertext
  • The non-secure random number generator used in ciphertext compression is seeded with number 42

Client then constructs a private key object from generated parameters:

const PrivateKey sk(params);

Encrypts the plaintext:

const vector<bool> plaintext = {1, 0, 1, 0, 1, 0, 1, 0};
const auto compressed_ciphertext = sk.encrypt(plaintext);

Serializes and sends compressed ciphertext to server.

Upon obtaining the compressed ciphertext, Server expands it to perform operations:

const auto ciphertext = compressed_ciphertext.expand();

Executes the algorithm (here negation of an 8-bit input)

const vector<bool> another_plaintext = {1, 1, 1, 1, 1, 1, 1, 1};
const auto response = ciphertext ^ another_plaintext;

Serializes the output and sends it back to the client.

Client decrypts the response and obtains the algorithm output in plaintext:

const auto decrypted_response = sk.decrypt(response);
const vector<bool> expected_result = {0, 1, 0, 1, 0, 1, 0, 1};
assert(decrypted_response == expected_result);

Note that ciphertext can be compressed only during encryption on the client side, so cost for Server → Client communication is significantly higher than that of Client → Server communication.

Available homomorphic operations

  • Bitwise addition (XOR): c1 ^ c2
  • Bitwise multiplication (AND): c1 & c2
  • Equality comparison: c0.equal({c1, c2, ..., cn})..
  • Selection of i-th ciphertext: c0.select({c1, c2, ..., cn}).

License

The code is released under the GNU General Public License v3.0.

Copyright © 2015 Bogdan Kulynych. hello [at] bogdankulynych.me

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].