Explainer: homomorphic encryption
February 2023Homomorphic encryption allows one to compute with encrypted data. There are several types and variants of homomorphic encryption. On this page we look at the Paillier cryptosystem: a probabilistic asymmetric algorithm with additive homomorphic properties. This page demonstrates the concept of homomorphic encryption using a Javascript implementation of the Paillier crypto system. In our software, we typically use more complex and powerful forms of additive and fully homomorphic encryption, but for this demo Pallier is very suitable.
In the demo you create the ciphertexts of two numbers. Anyone can compute an encryption of the sum of these two numbers, without revealing the underlying numbers themselves. Next step is to de-encrypt the aggregated answer, and you get your result!
Key generation
Public key (n): -
Private key (lambda): -
Elapsed time (key generation): - ms
Elapsed time (pre-computation): - ms
Test input
[A] = -
Elapsed time: - ms
[B] = -
Elapsed time: - ms
Encrypted addition
[A + B] = -
Elapsed time: - ms
Elapsed time (randomize): - ms
Encrypted multiplication
[(A + B)*C] = -
Elapsed time: - ms
Elapsed time (randomize): - ms
Decryption
(A + B)*C = -
Elapsed time: - ms