tags:

views:

281

answers:

2

How can I add a plaintext into encrypted ciphertext?

For example, I would like to add number 4 into encrypted(5)

A: 

@Bill the lizard: Well you can, if you are using ECB or any other block mode where the n+1 block doesn't require much knowledge about block n you can chain on an extra block (or even insert a block as in the case of ecb).

However this leaves you open to mitm-attacks and so on...

andy
Thanks, I edited my answer.
Bill the Lizard
+2  A: 

There are schemes that allow you to perform arithmetic on encrypted data without being able to decrypt the data. Such schemes are useful for for example electronic voting (you can tabulate the votes without being able to view the individual votes).

If you want details, lookup Homomorphic encryption.

Rasmus Faber
Grouping the ciphertext based on plaintext is a lot different from changing the actual value of the data being stored/transmitted.
Bill the Lizard
I am not sure I understand what you mean. I agree those things are different, but I do not see your point. Using Benaloh encryption, you can use the homomorphic property to calculate E(x)*E(4)=E(x+4). So you can add 4 to the encrypted number without being able to decrypt the number.
Rasmus Faber
Ah, did you think the voting application worked by counting the number of times the same string was being encrypted? I.e. counting the numbers of E(McCain) vs. E(Obama)? Actually it works (simplified) by people submitting either E(0,1) or E(1,0) and then adding E(0,1)+E(0,1)+E(1,0)=E(1,2) continued
Rasmus Faber
... then decrypting it to get the result 1,2.
Rasmus Faber
Yeah, the vote counting software should not be changing the encrypted data (let's hope). Aggregating the results should be possible without the ability to change the data itself.
Bill the Lizard