All Projects → n1analytics → javallier

n1analytics / javallier

Licence: other
A Java library for Paillier partially homomorphic encryption.

Programming Languages

java
68154 projects - #9 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to javallier

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 (+758.21%)
Mutual labels:  paillier, homomorphic-encryption
encrypted-geofence
testing out homomorphic encryption
Stars: ✭ 33 (-50.75%)
Mutual labels:  paillier, homomorphic-encryption
rust-paillier
A pure-Rust implementation of the Paillier encryption scheme
Stars: ✭ 78 (+16.42%)
Mutual labels:  paillier, 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 (+65.67%)
Mutual labels:  homomorphic-encryption
ecelgamal
Additive homomorphic EC-ElGamal
Stars: ✭ 19 (-71.64%)
Mutual labels:  homomorphic-encryption
libshe
Symmetric somewhat homomorphic encryption library based on DGHV
Stars: ✭ 24 (-64.18%)
Mutual labels:  homomorphic-encryption
node-seal
Homomorphic Encryption for TypeScript or JavaScript - Microsoft SEAL
Stars: ✭ 139 (+107.46%)
Mutual labels:  homomorphic-encryption
elgamalext
Extension for the .NET Framework cryptography subsystem, which introduces the ElGamal public key cryptosystem with support for homomorphic multiplication.
Stars: ✭ 14 (-79.1%)
Mutual labels:  homomorphic-encryption
WeDPR-Lab-iOS-SDK
iOS SDK of WeDPR-Lab-Core; WeDPR即时可用场景式隐私保护高效解决方案核心算法组件iOS SDK
Stars: ✭ 13 (-80.6%)
Mutual labels:  homomorphic-encryption
WeDPR-Lab-Android-SDK
Android SDK of WeDPR-Lab-Core; WeDPR即时可用场景式隐私保护高效解决方案核心算法组件Android SDK
Stars: ✭ 14 (-79.1%)
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 (-40.3%)
Mutual labels:  homomorphic-encryption
Seal
Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
Stars: ✭ 2,424 (+3517.91%)
Mutual labels:  homomorphic-encryption
federated
Bachelor's Thesis in Computer Science: Privacy-Preserving Federated Learning Applied to Decentralized Data
Stars: ✭ 25 (-62.69%)
Mutual labels:  homomorphic-encryption
threshold-signatures
Threshold Signature Scheme for ECDSA
Stars: ✭ 79 (+17.91%)
Mutual labels:  homomorphic-encryption
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 (+86.57%)
Mutual labels:  homomorphic-encryption
gomorph
Implementing Homomorphic Encryption in Golang 🌱
Stars: ✭ 76 (+13.43%)
Mutual labels:  homomorphic-encryption
fully-homomorphic-encryption
Libraries and tools to perform fully homomorphic encryption operations on an encrypted data set.
Stars: ✭ 2,737 (+3985.07%)
Mutual labels:  homomorphic-encryption
minionn
Privacy -preserving Neural Networks
Stars: ✭ 58 (-13.43%)
Mutual labels:  homomorphic-encryption
haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
Stars: ✭ 96 (+43.28%)
Mutual labels:  homomorphic-encryption
tf-seal
Bridge between TensorFlow and the Microsoft SEAL homomorphic encryption library
Stars: ✭ 90 (+34.33%)
Mutual labels:  homomorphic-encryption

Build Status Javadocs

javallier

A Java library for Paillier partially homomorphic encryption based on python-paillier.

The homomorphic properties of the paillier cryptosystem are:

  • Encrypted numbers can be multiplied by a non encrypted scalar.
  • Encrypted numbers can be added together.
  • Encrypted numbers can be added to non encrypted scalars.

To use the library add the following dependency to your SBT configuration:

libraryDependencies += "com.n1analytics" % "javallier_2.10" % "0.6.0"

Example usages are provided in the /examples source directory. A benchmarking script can be found in /benchmark.

Build

Compile the library:

$ sbt compile

Create a jar file:

$ sbt package

Run all tests with sbt:

$ sbt test

Or run just fast tests:

$ ./test-fast.sh

Command Line Tool

A small command line tool has been created to wrap the javallier library.

Use the javallier cli tool to:

  • generate and serialize key pairs (of different key sizes)
  • encrypt and serialize signed floating point numbers given a public key
  • add two encrypted numbers together
  • add an encrypted number to a plaintext number
  • multiply an encrypted number by a plaintext number
  • decrypt an encrypted number given the private key

Build the javallier CLI tool:

sbt assembly

This creates a javallier.jar jar file in:

./target/scala-2.10

To run it:

java -jar javallier.jar <COMMAND>  

Alternatively you can run directly with sbt:

sbt "runMain com.n1analytics.paillier.cli.Main"

Example CLI session

$ java -jar javallier.jar genpkey --keysize 256 -m "Example keypair" examplekey.priv
$ cat examplekey.priv | python -m json.tool
{
    "kty": "DAJ",
    "key_ops": [
        "decrypt"
    ],
    "pub": {
        "alg": "PAI-GN1",
        "kty": "DAJ",
        "kid": "Example keypair",
        "n": "AI9TjNmoL7p3j_D-RNK5AJQC1uDMtVvdy0MNi6ctj6Xn",
        "key_ops": [
            "encrypt"
        ]
    },
    "kid": "Example keypair",
    "lambda": "AI9TjNmoL7p3j_D-RNK5AJJ3odV_yUj39nLtFBMcrsoQ",
    "mu": "MDo136LqeN-R5W4kT2azGc6Y-cD77f6r_B6zncj48Eo"
}


$ java -jar javallier.jar extract examplekey.priv examplekey.pub
$ java -jar javallier.jar encrypt examplekey.pub "12" -o encA.json
$ java -jar javallier.jar encrypt examplekey.pub "8" -o encB.json
$ java -jar javallier.jar addenc examplekey.pub encA.json encB.json -o encC.json
$ java -jar javallier.jar decrypt examplekey.priv encC.json
20.0
$ java -jar javallier.jar add -o encD.json examplekey.pub encA.json 12
$ java -jar javallier.jar decrypt examplekey.priv encD.json
24.0

Releases

Releases will be signed by Brian Thorne with the PGP key 22AD F3BF C183 47DE

Creating a release

Update the version in build.sbt using semantic versioning. Update the CHANGELOG, git tag the new release.

Ensure you have sonatype credentials in ~/.sbt/0.13/sonatype.sbt, and install the pgp plugin (~/.sbt/0.13/plugins/pgp.sbt). Run sbt publishSigned, then visit the staging repositories of sonatype. Close the staging repository which will allow you to move to the release channel. Once you have successfully closed the staging repository, you can release it.

For more information:

Limitation

Adding two encrypted numbers where the exponents differs wildly may result in overflow in the EncryptedNumber domain. The addition result can be successfully decrypted and decoded but the computation result is incorrect. Current implementation does not detect such overflow.

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].