Pure python crypto

Michael Gilfix mgilfix at eecs.tufts.edu
Wed Apr 17 10:21:46 EDT 2002


  The nice thing about blowfish is its simplicity. I started thinking
about implementing DES and 3DES though and its ugly. The perl
module version seemed to go at great lengths to do some interesting
optimizations which are difficult to follow but increase speed
considerably.

  I was thinking that it might be nice to have an 'ssh' module or
'sftp' module. Specifically, I wanted sftp for an application and
couldn't find any such modules. For portability reasons, it might
be nice to have a pure python module, however, it would require
some tweaking I'm sure.

                 -- Mike

On Wed, Apr 17 @ 01:06, Paul Rubin wrote:
> Michael Gilfix <mgilfix at eecs.tufts.edu> writes:
> >   Would anyone have any use for a pure python implementation of
> > Blowfish? Or any other crypto algorithms for that matter.  As a matter
> > of interest, I found myself implementing the blowfish module recently
> > but was unsure if any audience would be interested. No C compiler
> > is required, which is nice. Could use some testing though.
> 
> I wouldn't mind having it, but it wouldn't be THAT useful, as it
> would be awfully slow, and I don't know of any important programs
> to interoperate with that need Blowfish.
> 
> DES/3DES seems more important for interoperability purposes.  I coded
> them in pure Python but made a mistake somewhere, so the test vectors
> don't work correctly, and I never got around to debugging it.  I should
> take a look at it again.
> 
> If you just want to encrypt in Python without custom C modules, after
> a fair amount of experimentation the fastest way I found is to use the
> SHA module in output feedback mode to generate a keystream from the
> key and a random initialization string, and use the array module to
> combine the keystream with the plaintext.  This works pretty well on
> Un*x/Linux because the /dev/urandom device makes it easy to get the
> initialization strings.  However, there's no good source of such
> strings under Windows using the standard modules at the moment.
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
`-> (phr-n2002a)

-- 
Michael Gilfix
mgilfix at eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 236 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20020417/191b7321/attachment.sig>


More information about the Python-list mailing list