Context: an encryption game from overthewire (the link to it: https://overthewire.org/wargames/krypton/krypton6.html, also good for more info) where given the ciphertext, one must obtain the plaintext.
On this level, we have access to a binary that encrypts any file by stream cipher, using a key from a file we do not have access (keyfile.dat) and a random number. We also have a hint: 8 bit LFSR.
My question is the following. Why can't I get back the plaintext encrypting the ciphertext?
My two assumptions for this claim are:
1) We're dealing with stream cipher, so encrypting the ciphertext should always give the plaintext, as long as the keystream is the same in both cases, what leads me to the second point;
2) I tried to encrypt two different files but with the same content (text) and the encrypted output in both cases was the same, so the keystream must be equal.
I know I'm wrong, as encrypting the ciphertext doesn't give me the plaintext, but rather some non-sense-random-even-more-encrypted file. Can you help me understand what's wrong with my reasoning?
Thanks in advance for any help.