Re: Authenticated encryption with PyCrypto

2010-01-26 Thread geremy condra
On Tue, Jan 26, 2010 at 4:00 PM, M.-A. Lemburg wrote: > > > geremy condra wrote: >> On Tue, Jan 26, 2010 at 12:37 PM, M.-A. Lemburg wrote: >> >> >> >>> 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 t

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread geremy condra
On Tue, Jan 26, 2010 at 7:23 PM, Daniel wrote: > I understand the risks of unpickle. With strong, authenticated > encryption I think it is reasonably safe to send an encrypted pickle > through an untrusted medium (the Internet) and know that it has not > been modified enroute. That is, unless s

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread Daniel
M.-A. Lemburg wrote: > Daniel wrote: > > On Jan 26, 12:37 pm, "M.-A. Lemburg" wrote: > >> Note that your code has a padding bug: the decoder doesn't > >> undo the padding. You're lucky though, since pickle will only > >> read as much data as it needs and not complain about the extra > >> data it f

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread Daniel
geremy condra wrote: > I'd also note that you aren't supposed to use RandomPool anymore, OK, I updated the recipe to use os.urandom() > and that AES-192 is frequently recommended over AES-256 for > new applications due to a number of recent developments in > the cryptanalysis of its key schedule.

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread M.-A. Lemburg
Daniel wrote: > On Jan 26, 12:37 pm, "M.-A. Lemburg" wrote: >> Note that your code has a padding bug: the decoder doesn't >> undo the padding. You're lucky though, since pickle will only >> read as much data as it needs and not complain about the extra >> data it finds. > > Doesn't the last line

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread Daniel
On Jan 26, 12:37 pm, "M.-A. Lemburg" wrote: > Note that your code has a padding bug: the decoder doesn't > undo the padding. You're lucky though, since pickle will only > read as much data as it needs and not complain about the extra > data it finds. Doesn't the last line in decrypt() do it?

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread M.-A. Lemburg
geremy condra wrote: > On Tue, Jan 26, 2010 at 12:37 PM, M.-A. Lemburg wrote: > > > >> 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. > > However, ECB mode is not as secure- the IV is

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread M.-A. Lemburg
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/ >> > [...] > Yo

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread Paul Rubin
Daniel writes: > Of course, it does not meet all of the requirements set forth by the > OP in the referenced thread (the pycrypto dependency is a problem), > but it is an attempt to provide a simple interface for performing > strong, password-based encryption. Are there already modules out there >

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread geremy condra
On Tue, Jan 26, 2010 at 12:37 PM, M.-A. Lemburg wrote: > 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. However, ECB mode is not as secure- the IV is the right way to go here. I'd also n

Re: Authenticated encryption with PyCrypto

2010-01-26 Thread M.-A. Lemburg
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/ > > Of course, it does not meet all of th

Authenticated encryption with PyCrypto

2010-01-25 Thread Daniel
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/ Of course, it does not meet all of the requirements set forth by the