def Encrypt(self, plaintext, r_value=None):

    if not isinstance(plaintext, int) and not isinstance(plaintext, long):
      raise ValueError('Expected int or long type plaintext but got: %s' %
                       type(plaintext))
    r = r_value or self._GetRandomFromZNStar(N_LENGTH, self.n)
    return (ModExp(self.g, plaintext, self.nsquare) *
            ModExp(r, self.n, self.nsquare)) % self.nsquare
Paillier encryption of plaintext.
dataset/ETHPy150Open google/encrypted-bigquery-client/src/paillier.py/Paillier.Encrypt