Could someone PLEASE either explain to me how, or point me to a tutorial that will tell me the simplest possible way to write the Rijndael (AES or very similar) algorithm into C#? Specifically 256-bit key size. I just want to make a function that takes an array of bytes or data (will be divisible by 256), and a 256-bit key also as an array of bytes, and outputs a new array of bytes that is encrypted.
I've been looking on Wikipedia, and it explains the steps of the algorithm, but then redirects to all sorts of number theory and abstract algebra crap that I have to wade through endlessly just to get anything done at all! I'm rusty on all that convoluted nonsense. I studied it some years ago, but it's so absurdly esoteric and covered with so many weird rules and red tape that it's almost impossible to make any sense of it.
I'm very good at math in general (calculus, etc.), but is it really necessary to get into all the details about finite fields and all that, just to build the sub bytes matrix?
The shift rows is easy, fortunately.
I'm not sure I fully understand the mix columns step either. And the example they give on Wikipedia is 16 bytes (128 bits), but I need 256 bits anyway.
The add round key step should be easy enough, but only after I figure out what the current round key is, and I'm not sure if I understand the key scheduling either, but I haven't looked into it as much yet.
Any info you could provide would be much appreciated, thanks!