Main cipher objective : Generate a keyed CSPRN stream, that does not expose useful information about the state of the CSPRNG, and xor this with the plaintext. To prevent an attacked who could somehow recover state or key information from one ciphertext from using this on other ciphertexts, a "random section", here called an IV, is appended to the original key, before it is scheduled (hashed into the state of the CSPRNG).
The question concerns one final part of the algorithm not mentioned above : to transmit this "once generated" IV, it is encrypted with the original key (after scheduling the original key into the state of the CSPRNG), and appended to the output. How secure is this formulation ? Where original key is used 1 time to encrypt the random IV, and a novel key formed from original key + unencrypted IV is used 1 time to encrypt plaintext ?
As a list of instructions, the use of the IV proceeds like this :
- Generate 37 random 32 bit integers
- Pack these into bytes
- Using the user key (which has been scheduled), encrypt these bytes, so the IV can be saved to file
- Concatenate the original (unscheduled) user key with the unencrypted IV bytes
- Reschedule this key, to give the final state of the stream generator before encryption
The encryption combination function is symmetric, just xor.