So i got a few xml files that need to be encrypted and it works, no problems here. Now since the latest update of the CodeAnalyzers i got a new warning ( CA5401 ) that tells me, that it is a bad idea to have a "nonstandard initializing vector". A little research showed me, why it is indeed a good idea to have a new IV each time a message is encoded. I shall use random IVs, it says.
However, i still need the exact same IV to decode that file, so using a newly generated IV to open a file from last friday won't work.
However then i saw this: https://www.codeproject.com/Articles/556454/Encrypt-and-Decrypt-Text-with-a-Specified-Key
Where basically the IV is used as the first bytes of each encryted text and thus, an unencrypted part of the data.
Is this how it is meant to be done?