Suppose we have the following symmetric algorithm:
key = random bits G = PRNG(seed: key) input = [0,1,1,0,1,0,0,0, 0,1,1,0,1,0,0,1] // "hi" in ascii
The key can be thought of as a sufficiently large bit string (say 256 bits).
encrypted =  for each decrypted_bit in input random = G.generate() encrypted_bit = first_bit_of(random) XOR decrypted_bit first_bit_of(random) = first_bit_of(random) XOR decrypted_bit append_to(encrypted, encrypted_bit) G.seed(random)
The decryption algorithm seeds the PRNG with the same key, and performs the following actions:
decrypted =  for each encrypted_bit in encrypted random = G.generate() decrypted_bit = first_bit_of(random) XOR encrypted_bit first_bit_of(random) = first_bit_of(random) XOR decrypted_bit append_to(decrypted, decrypted_bit) G.seed(random)
Suppose each message sent is prepended with a randomly generated 512 bit string, causing the random generator to output different ciphertexts for the same input.
How do I break this scheme? Can I find a pattern in the PRNG using a known-plaintext attack? The current PRNG is the Mersenne Twister "MT19937", generating 64 bits. What PRNGs are vulnerable to this? Which aren't?
Some additional information: For a key with the value 9145160492174859451, "hi" is encrypted to
Encrypts the last two characters as