# How to detect if n long messages have encrypted with the same one-time pad?

I have a slight idea on what the attack would be. But my question is: how would one detect if n long messages (n>5) have been encrypted with the same one time pad, K?

• Typically, you'd XOR the messages together pair-wise and see if the resulting bit distribution has some detectable patterns (because it should be the XOR of two plain texts). – SEJPM Feb 12 '17 at 20:42
• With 5 messages you may simply be able to calculate (most of) the key stream. In that case the solution is easy: check if the plaintext is anywhere near the content you expect it contains. If the plaintext of the (additional) messages is fully random (for you) then - of course - you've got no way to check. – Maarten Bodewes Feb 12 '17 at 21:37

Specifically, the $K(K-1)/2$ symbolwise difference of the, say $K$, messages should obey the plaintext distribution. If the plaintext is in a natural language, patterns can be detected using various techniques.
If the messages are binary $n=5$ won't be nearly enough. If the messages are in ASCII, $5$ symbols yield 40 bits, so that might be enough, and you'd even rule out key guesses that don't yield printable ASCII characters when XORed with ciphertext.