✅ Stream assistance needed
Alright I really need I'm completely lost. I have a file containing the following: 1 versioning byte used for retro-compatibility purposes, a 16 bytes long IV, X bytes of data and 64 bytes-long HMAC, everything in this exact order. Encryption is not the problem, decryption is. Since I used streams for better performances and less memory allocations than arrays, I read things in order, first the versioning byte to determine which method to use, then the IV to calculate the key and then problems are here. Since the HMAC is at the end, I need to decrypt the X following bytes = the rest of bytes - the 64 last. And I just can't. I tried using .SetLength on a new MemoryStream, also tried .Capacity, nothing is working. I am thus requesting your help.