Encryption - show probability for obtaining specific bit

69 Views Asked by At

Assume a person A encrypts a message which consist of the bits m1, ..., mn. The person is using the one-time pad algorithm.

Another person B intercepts the ciphertext and we suppose he knows that mi (the original bit at position i in the message), is 0 with probability p.

Person B would like to modify the ciphertext so that the receiver will decrypt a 0-bit at position i, in the message.

I have to show that person B can make the receiver obtain a 0-bit in position i with the probability max(p, 1-p).

I'm not really sure if I have understood the question correctly, but if person B knows that mi, the originial bit at position i in the message, is 0 with probability p, then if he just leaves the ciphertext and doesn't modify anything, the receiver will obtain a 0-bit in position i with probability p. If he modifies the ciphertext by moving the bit mi to another position, so that another bit will have the position i, then the probability for the receiver to obtain a 0-bit in position i can be 1-p but not necessarily? Or am I completely wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

As has been discussed in the comments, the attacker flips the bit if $p\lt\frac12$. It will be $0$ with probability $1-p$ if she flips and $p$ if she doesn't. The attacker can choose to flip or not to flip and chooses the one that yields the higher probability, which is thus $\max(p,1-p)$.