With the exception of the one-time pad, no cipher has been theoretically proven to be unbreakable.
To prevent this kind of attack, one can use the method provided by Bruce Schneier in the references below: generate a random pad of the same size of the plaintext, then XOR the plaintext with the pad, resulting in a first ciphertext.