pkenc_paillier99

Pascal Paillier (Public-Key)

From: “Public-Key Cryptosystems Based on Composite Degree Residuosity Classes”
Published in: EUROCRYPT 1999
Notes:
  • type public-key encryption (public key)
  • setting: Integer
Authors:J Ayo Akinyele
Date:4/2011 (updated 2/2016)
class pkenc_paillier99.Ciphertext(ct, pk, key)[source]

Bases: dict

This tests the additively holomorphic properties of the Paillier encryption scheme.

>>> from charm.toolbox.integergroup import RSAGroup
>>> group = RSAGroup()
>>> pai = Pai99(group)
>>> (public_key, secret_key) = pai.keygen()
>>> msg_1=12345678987654321
>>> msg_2=12345761234123409
>>> msg_3 = msg_1 + msg_2
>>> cipher_1 = pai.encrypt(public_key, msg_1)
>>> cipher_2 = pai.encrypt(public_key, msg_2)
>>> cipher_3 = cipher_1 + cipher_2
>>> decrypted_msg_3 = pai.decrypt(public_key, secret_key, cipher_3)
>>> decrypted_msg_3 == msg_3
True
randomize(r)[source]
class pkenc_paillier99.Pai99(groupObj)[source]

Bases: charm.toolbox.PKEnc.PKEnc

L(u, n)[source]
decode(pk, element)[source]
decrypt(pk, sk, ct)[source]
encode(modulus, message)[source]
encrypt(pk, m)[source]
keygen(secparam=1024)[source]
pkenc_paillier99.debug = False

A ciphertext class with homomorphic properties