# How to break fully homomorphic encryption over integer algorithm with known cipher of same integer?

If I do encryption and decryption like this:

Encryption: $$\text{E}(m) = (r \times p_1+m) \bmod N$$

Decryption: $$\text{D}(\text{E}(m)) = ((r \times p_1 + m) \bmod N) \bmod p_1 = m$$

where,

$$r$$ = random number

$$p_1$$ = random large prime

$$m$$ = plain text (int)

$$N$$ = product of two large primes $$p1 \times p2$$

So, my question is if $$\text{E}_1(m)$$ and $$\text{E}_2(m)$$, two different ciphers for the same integer are known, what could be done to break the algorithm?

This question is for my assignment but I do not have a clue where to start. A little clue will be appreciated.

Thanks.

• That's not the cipher from Fully Homomorphic Encryption Over The Integers. There's no noise/error term attached for starters, which makes a big difference. Anyways: What if $m = 0$? Mar 27 '19 at 2:17
• @EllaRose: actually, there is an 'error' term; the value $r$, which is a random value for every encryption. Mar 27 '19 at 12:27
• However, the 'what if $m = 0$?' question is a pretty good hint. Could you figure out how to break it if you were given an encryption of 0? If so, could you figure out how to obtain the encryption of 0 given two different encryptions of the same value? Mar 27 '19 at 12:29
• Thanks for the comment. @ Ella Rose, yes this is not the actual encryption. It has a flaw and my question was knowing the two cipher of the same integer what can I do to break this algorithm or what could be done with the known information. And for m, let's say that m will not be 0. Mar 28 '19 at 16:21
• @poncho, I think there is nothing wrong with the r as this is a nondeterministic algorithm. so it is expected that the value of r to be different in every encryption. And that's how we get different cipher for the same m. Please correct me if I'm wrong. Mar 28 '19 at 16:42