Home All Groups Group Topic Archive Search About

RijndaelManaged without padding

Author
4 Dec 2006 11:24 AM
Daniel Meier
Hey

I'd tried to use the RijndaelManaged-Class to encrypt some data. The
size of the encrypted data have to be exactly the same as the original
data. Is there a way to do this with RijndaelManaged? I thought I can
use the CTS-Mode, but RijndaelManaged doesn't support this.

Thank you
Daniel

Author
4 Dec 2006 3:37 PM
Carl Daniel [VC++ MVP]
Daniel Meier wrote:
> Hey
>
> I'd tried to use the RijndaelManaged-Class to encrypt some data. The
> size of the encrypted data have to be exactly the same as the original
> data. Is there a way to do this with RijndaelManaged? I thought I can
> use the CTS-Mode, but RijndaelManaged doesn't support this.

Generally, when working with NET, you shouldn't use the cipher classes
directly.  Instead, use them through CryptoStream, which takes care of
odd-length messages, etc.  It's undocumented (as far as I can find) exactly
how CryptoStream uses the cipher - but presumably it's something along the
lines of OFB or CBC+CTS (hopefully the latter since it's ~8x faster).

-cd

AddThis Social Bookmark Button