[Python-Dev] Parametrized codecs

M.-A. Lemburg mal@lemburg.com
Thu, 20 Sep 2001 12:05:07 +0200


Andrew Kuchling wrote:
> 
> On Tue, Sep 18, 2001 at 04:31:31PM -0400, Gordon McMillan wrote:
> >RC4, maybe. But I think you're asking for trouble in trying to
> >pretend a block-mode cipher is a stream.
> 
> Dunno, but we'll hash that out on the python-crypto list.  For now I
> just wanted to know if parametrized codecs would be an inherently bad
> idea.
> 
> (Two ways of handling this would be requiring all write() calls to use
> a multiple of the block size, or reporting an error on the close() if
> you haven't written out an even number of blocks.  I have no idea
> which is preferable; not sure I like either of them...)

I guess you'll need some kind of buffering in the reader/writer
to handle this situation. The cipher.py tools in mxCrypto does
this already, so it may serve as template for the needed code.

(This is getting off-topic though for this list...)

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/