Given a set of plain texts $P \subseteq \{0, 1\}^n$. Assume we know the corresponding set of cipher texts $C \subseteq \{0, 1\}^n$ produced by applying one-time pad with an unknown key $k \in \{0, 1\}^n$.
Question: How to compute $k$, based on $P$ and $C$?
My approach: For every pair $(p, c) \in P \times C$, compute the key $k' = p \oplus c$. Output the key most frequent key $k'$.
My question: What is the probability of success of the proposed algorithm?
The problem with this approach is that the most frequent key $k'$ is unique in some cases. In some other cases, $k'$ is not unique. For example, when $P = C = \{0, 1\}^n$.