[Mono-list] SymmetricTransform

Sebastien Pouliot Sebastien Pouliot <spouliot@videotron.ca>
Sat, 19 Oct 2002 14:27:45 -0400

> It would be nice to factor out code to do the various feedback
> modes, rather than having seperate version in each block cipher.  It
> would make it a lot faster to implement all of the modes too!

I've taken the suggestion of Andrew Birkett <andy@nobugs.org> to create a
new class (SymmetricTransform) to handle much of the repetitive stuff
required for implementing a symmetric algorithm. The new class (included in
SymmetricAlgorithm.cs) handles the different CipherMode, PaddingMode and all
methods required for the ICryptoTransform interface (and is based on the
work done by Sergey, Andrew and others on the various algorithms).

The good news is that a new symmetric algorithm just have to overide the
abstract ECB method of SymmetricTransform and include it's own constructor
to setup its cipher. Right now I've commited the modified Rijndael class,
I'm testing the RC2 class and will do DES and TripleDES afterward.

To test the SymmetricTransform class a new SymmetricAlgorithmTest.cs file
was commited. The source code is generated by a tool to try every algorithm
default implementation (using Create), using every mode of operation,
padding, key size and block size. Right now Mono passes 102 out of 189

what's still not working
- DES (I probably messed too much with it)
- Rijndael decryption with block size 192 and 256
- CFB mode
- TripleDES (not implemented)

what's seems not supported in the MS Framework
- CFB mode (in Rijndael)
- OFB mode (for every cipher)
- CTS mode (for every cipher)
? does anyone know (or have a book) describing these two modes in .NET ?

Sebastien Pouliot
Security Architect, Motus Technologies, http://www.motus.com/
work: spouliot@motus.com
home: spouliot@videotron.ca