ssavvides / homomorphic-c

Various PHE and PPE encryption schemes written in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHE and PPE schemes

A collection of various Partially Homomorphic Encryption (PHE) schemes and Property-Preserving Encryption (PPE) schemes.

In some cases multiple implementations of the same encryption scheme are provided.

Currently the library contains implementations of:

  • AES
    • AES – using the tiny-AES repo
    • AES-SSL – using the openSSL implementation
  • FNR (ref repo)
    • FNR - using tiny-AES internally
    • FNR-SSL - using openSSL
  • ElGamal
    • ElGamal-BD – using the BIGD primitive of the BigDigits library
    • ElGamal-BN – using the BIGNUM primitive of the openSSL library
    • ElGamal-GMP – using the mpz primitive of the GMP library
  • Paillier
    • Paillier-BD – using the BIGD primitive of the BigDigits library
    • Paillier-BN – using the BIGNUM primitive of the openSSL library
    • Paillier-GMP – using the mpz primitive of the GMP library and using this repo as a reference

In some cases multiple encryption/decryption implementations are explored.

  • For all versions of ElGamal and Paillier, we implement encrypt_pre versions of encryption which assumes a random value has been pre-computed.
  • For all versions of ElGamal and Paillier, we implement encrypt_packed and decrypt_packed versions of encryption and decryption respectively which packs multiple plaintext values into a single ciphertext.
  • For all versions of Paillier we also implement the g = n + 1 optimization and the decryption based on the Chinese Remainder Theorem decrypt_crt.
  • For the BN and GMP versions of ElGamal and Paillier, support for negative numbers is added. The BigDigits library does not support negative numbers.

Please note these are Proof Of Concept implementations.

About

Various PHE and PPE encryption schemes written in C

License:Apache License 2.0


Languages

Language:C 98.4%Language:C++ 1.4%Language:Makefile 0.2%