Example of Pailier cryptosystem implemented in SageMath and used in CoCalc
The Paillier cryptosystem, invented by and named after Pascal Paillier in 1999, is a probabilistic asymmetric algorithm for public key cryptography. The problem of computing n-th residue classes is believed to be computationally difficult. The decisional composite residuosity assumption is the intractability hypothesis upon which this cryptosystem is based.
The scheme is an additive homomorphic cryptosystem; this means that, given only the public key and the encryption of m1 and m2, one can compute the encryption of m1 + m2. A notable feature of the Paillier cryptosystem is its homomorphic properties along with its non-deterministic encryption.