AES256EncryptionFormatter unable to handle ECB CipherMode

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

mrvernon_at_gmail.com
Date: 03/12/05


Date: 12 Mar 2005 00:42:40 -0800

I'm experiencing this problem in WSE 2.0r2.

Code that reproduces the bug:

        // create a Rijndael using the ECB cipher mode
        Rijndael rijndael = new RijndaelManaged();
        rijndael.Key = keybytes;
        rijndael.IV = ivbytes;
        rijndael.Mode = CipherMode.ECB;

        // Create the encryption formatter off the Rijndael
        AES256EncryptionFormatter aes = new AES256EncryptionFormatter(
rijndael );
        aes.Encrypt( plaintext );

The problems:
- The plaintext is encrypted in CBC mode, rather than ECB.
- Encrypt() sets rijndael.Mode to CBC. Encrypt() also appears to reset
other fields in the rijndael object.
- There is no exception raised, nor any other notification that the
formatter class doesn't work with ECB. It also does not appear to be
documented.

This seems to be a bug. Why doesn't the formatter class work with
other cipher modes, and (if that is by design) why doesn't it at least
raise an exception instead of silently using another ciphering mode?

Thanks.



Relevant Pages

  • Re: AES Questions From Another Dummy.
    ... argument to the encrypt and decrypt functions. ... ECB is bad. ... agent in encryption to ensure identical texts don't encode to the same result) ... the ciphertext/plaintext to/from the users is an open question. ...
    (sci.crypt)
  • Re: Rijndael Decryption not working
    ... Stream streamToConvert = ConvertStringIntoStream; ... CryptoStream kbsCryptoStream = new CryptoStream(streamToConvert, ... I can encrypt without any problem but while decrypting I got junk. ... Rijndael rijndaelAlgorithm = Rijndael.Create; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: encrypted drives in ms windows
    ... If you used CTR mode then this construction is at least as secure as ... Blowfish + 3DES has a higher strength with regard to brute ... Rijndael, on the other hand has a much smaller key of 128-bits. ... and performance is an issue here since you plan to encrypt an entire ...
    (sci.crypt)
  • Re: Is triple DES in ECB mode secure?
    ... ]> the reason why they use ECB is to increase the speed of data processing. ... it is not easy to find files on your hard disk ... So, assuming that they encrypt file by file, ... Security is not a dongle. ...
    (sci.crypt)
  • Re: Fastcode AES B&V 0.1
    ... TAESContext; Encrypt: Boolean); ... procedure EncryptAES_TurboLock(const Context: TAESContext; var Block: ... These functions implements the core AES/Rijndael block cipher functionality. ... They define no modes such as ECB etc. ...
    (borland.public.delphi.language.basm)