pkenc_paillier99¶
Pascal Paillier (Public-Key)
From: “Public-Key Cryptosystems Based on Composite Degree Residuosity Classes”
Published in: EUROCRYPT 1999
Available from: http://link.springer.com/chapter/10.1007%2F3-540-48910-X_16
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
-
pkenc_paillier99.
debug
= False¶ A ciphertext class with homomorphic properties