basic symmetric scheme:
The secret key is odd integer, chosen from some interval p∊ [2n-1 , 2n] where n is the bit length of the secret key. The cipher-text of a plain-text m∊ {0,1} is given by:
c = Encrypt (p, m) = pq + 2r + m
Where the integers q, r are chosen randomly in some other intervals, such that 2r is smaller than p/2 in absolute value. In this scheme, the cipher-text is an integer whose residue mod p has the same parity of the plaintext m.
Decrypt (p, m) = (c mod p) mod 2r
The decryption works as long as the noise r is much smaller than p.
m’ ←[ c- ⌊c/p˥ ]2
2) Homomorphic behavior: Suppose that we have two plain-texts m1,m2, with two ciphertextsrespectively c1 = pq1 + 2r1 + m1, c2 = pq2 + 2r2 + m2 .
a) Addition:
c1+ c2= p(q1+ q2) + 2(r1+ r2) + m1+ m2
Decryption works as long as 2(r1 + r2) ∊ [-p/2, p/2].
b) Multiplication:
c1 × c2 = p(pq1q2 + 2r2q1 + q1m2 + 2q2r1 + m1q2) + 2(2r1r2 + m2r1 + m1r2) + m1m2
Decryption works as long as 2(2r1r2 + m2r1 + m2r2) ∊ [-p/2, p/2]