How is Homomorphic Encryption secure (over integers)? I have been reading a bit about homomorphic encryption, and have been intrigued by its properties.

If I have some cryptosystem that is homomorphic and supports addition, from my understanding, I can do this:

E(A) + E(B) = E(A+B)

...And then I can decrypt E(A+B) without knowing either A or B.

However, if A and B were something like salaries stored somewhere...

E($120k) + E($100k) = E($120k + $100k) = E($220k)

From what I understand, I may not be able to decrypt A or B, but I can calculate A or B given some math. For example:

D(E(A+B)) = $220k (since I can decrypt the result without knowing the individual encryptions)
X = E(-$220k) (since I can encrypt any values myself)
X + E(A) = E(-$220k) + E($120k) = E(-$100k) (this gives me the negative of B... but I can negate that to get B)

Am I understanding this correctly? If so, how is homomorphic encryption secure?
The use case for homomorphic encryption is that I encrypt my own data with my public key. I then ship this data to the cloud. The cloud can perform operations on those ciphertexts. But, since the cloud does not have the private key, the cloud cannot decrypt the results of the operations.

Once the operations have been performed, the cloud sends the resulting ciphertext back to me. I can decrypt that to get the answer.

So the key is allowing another untrusted party access to encrypted versions of my data that they can compute on, but can't get the results of the computations. If someone else encrypts their private data with your public key and sends it to you, you will be able to get their private data since you can decrypt.