I'm trying to decrypt a message that has been encrypted using a one-time pad with a repeated key. The encryption technique involves using the same key twice. We know the message was encrypted with $k = k_0 \ ||\ k_0$ and that the length of the subkey $k_0$ is half the length of the complete key. We also know that the encoding is 8-bit ASCII and the plaintext is in English.
I tried to use the fact that
$$ (M_1 \oplus k) \oplus (M_2 \oplus k) = M_1 \oplus M_2 $$
to split the encrypted message into two parts, XOR them, and convert the result to ASCII, but this approach hasn't yielded a correct plaintext. Additionally, I've tried matching the frequencies of the bytes in the XORed message to the frequencies of English letters, but this method also failed to provide a satisfactory result.
Is there a proper way to decrypt the message under these conditions?
A
withA
then the result is obviously 0x00 (assuming 8 bits per character). For good frequency analysis and such you need quite a few bits of plaintext. As fgrieu mentioned: it is possible that there is more repetition and a smaller key size, which gives you more to work on, because basically you get a $n \times (n - 1) \over 2$ possible combinations. Every-time you guess a character (and thus a key) the other location of key reuse may result in a less likely character. – Maarten Bodewes Mar 20 '24 at 22:05