I'm trying to use the AesManaged class in C#, and I have a problem (and no, I don't have the source code available, but I can explain what I'm doing).
I have it set to 128 bit blocks and 256 bit keys.
I'm using ECB mode, an all zero IV and padding my data with zeros. This may seem stupid, but I'm always encrypting only tiny pieces of data that are exactly 16 bytes/128 bits (so I initially tried it with no padding, but I got an error, so I switched to zeros), and I have other encryption too, so security is not going to be a problem in this case.
Anyway, I have it encrypting fine. I give it the data and key, and it gives me back seemingly random data. Then when I try to decrypt using the ciphertext and the same key, it gives me back a null string or array of zeros (depending on which stream reading function I use). I based my program on the MSDN example for AesManaged at the bottom of this page:
https://msdn.microsoft.com/en-us/library/system.security.cryptography.aesmanaged(v=vs.110).aspx
So it's basically like that but with a few setting slightly different. What could be wrong?