Authenticated encryption with PyCrypto

M.-A. Lemburg mal at egenix.com
Tue Jan 26 15:52:31 EST 2010


M.-A. Lemburg wrote:
> Daniel wrote:
>> Just got done reading this thread:
>>
>> http://groups.google.com/group/comp.lang.python/browse_thread/thread/b31a5b5f58084f12/0e09f5f5542812c3
>>
>> and I'd appreciate feedback on this recipe:
>>
>> http://code.activestate.com/recipes/576980/
>>
> [...]
> You are also using CBC mode, even though you are really after
> ECB mode (your code doesn't use chaining). With ECB mode, you
> don't need the IV string.

Sorry. Forget that last comment - your code does use chaining.
It's hidden away in the PyCrypto code for block cipher encoding:
the .encode() method will automatically apply the cipher to
all blocks of 32 byte input data and apply chaining to all
of them (initializing the data area with the IV string).

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jan 26 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the Python-list mailing list