We have a one time pad where:
We have 8 bits. probability that a bit=0 is p.
The key is common for all 8 bits. It can have a value of 0 or 1 with equal probability.
After applying the XOR operation we take the encrypted result that has n zeros and 8-n ones.
What I am asked to do is calculate the probability that the key used is 0.
Until now I am thinking like this:
There are 2 events:
EventA. We have k zeros in the original 8 bits
EventB. We have k zeros in the encrypted data.
P(A) can be calculated from the binomial distribution P(B) = 2P(A) I am searching the probability P(key=0|P(B)).
Is my thinking correct until now? How can i procede from there?