Im working on an algorithm to break a modified Vigenere Cipher. The regular Vigenere cipher works in the following way:
Plaintext: ATTACKATDAWN Key: LEMONLEMONLE Ciphertext: LXFOPVEFRNHR
CR[i] = (P[i] - 33 + K[i]) mod 94 + 33
CM[i] = (P[i] - 33 + K[i] + CM[i-1] - 33) mod 94 + 33
Notice how the modified version uses previous state/character to generate the new one. My theory to break it is to reverse the modified version back to the regular Vigenere cipher. This way I can apply some frequency analysis and other methods. I need to somehow rearrange that equation such that I have "previousC" on the LHS with C. Since both C and previousC are known values it should be easy to do the reversal (starting with the first character).
My only problem is, how do I rewrite the equation in terms of C and previousC? If someone could point that out that would help a lot.