Most likely, you are not using the correct fill and lock modes for the RijndaelManaged instance (called the provider in the code below). Since the symmetric encryption providers in .NET are all block ciphers, these parameters affect the operation of the add-on (as well as how secure the output will be).
The settings below will provide you maximum security when using RijndaelManaged:
// set the padding algorithm provider.Padding = PaddingMode.ISO10126; // default is PKCS7 // set the block chaining mode provider.Mode = CipherMode.CBC;
If you are not the one who encrypts the data, and you cannot determine what settings are used for the outgoing side, you will find help in some other answers :)
Morten mertner
source share