This MESSED ME UP hard. I thought i was setting the key but i was not. No exceptions, nothing happen except bad results. Why is there a setter if everything is ignored and no exceptions are thrown when i attempt to write? What is the point of the setter on the Keys property?
When i do the below Key value are not changed. After an hour when i realize what was happening i wrote the loop to verify. I also tried aes.Key[0] = val; var b = val == aes.Key[0]; (and messed with it in immediate mode).
Why does it have this behavior?
Array.Copy(myKey, aes.Key, aes.Key.Length);
int i = 0;
foreach (var v in aes.Key)
{
var b = myKey[i++] == v;
if (!b)
b = b;
}