I have next code:
FileStream fs = new FileStream("test.crp",FileMode.Create);
Aes aes = Aes.Create();
FileStream fsKeys = new FileStream("keys.key",FileMode.Open);
fsKeys.Read(aes.IV,0,16);
fsKeys.Read(aes.Key,0,32);
fsKeys.Close();
And the problem is that: aes.IV and aes.Key are not changed during the Read operation from file.
And I can only assign a new value to them using the assignment operators:
byte [] iv = new byte[16];
byte [] key = new byte[32];
aes.IV = iv;
aes.Key = key;
Is it a right behavior? If so, Then to what memory block do I read, when I use fs.Read?