[PYTHON-CRYPTO] Comments

Richard Jones richard at BIZARSOFTWARE.COM.AU
Tue Feb 13 04:42:52 CET 2001


PC Drew wrote:
> --On Monday, February 12, 2001 9:54 PM -0500 Dan Parisien
> <dan at eevolved.com> wrote:
> > Yeah, shouldn't Yarrow be distributed with standard python? Or a
> > secure random number generator that adheres to the standard Python random
> > number
> > generator interface but uses a source of safe entropic data as a default
> > seed. (aka: yarrow or whatever is available on the OS like the /dev/*rand
> > series)
>
> I think so.  Anyone object?  I think we should lobby for that when we get
> things up and running.

You could punt the idea to python-dev... I thought I saw something
somewhere talking about an improved random module going into python 2.1,
but I can't find a reference at the moment.


> > class Symmetric:
> >     """
> >     Base class for symmetric cipher
> >
> >     Important Attributes:
> >
> >     . key : Key to use for encryption/decryption
> >     """
> >     def __init__(key=None)
> >         """
> >         Constructor
> >
> >         . key : (optional) key to use for encryption/decryption
> >
> >         Raises EncryptionKeyError if the key is not of a valid size, etc
> >         """
> >
> >     def keygen(size=None)
> >         """
> >         Generate a symmetric encryption key using a default (and
> >         replaceable) secure prng.
> >
> >         . size : (optional) bit size of the key. If None, use a reasonable
> >             default. (I think bit size is more intuitive considering it is
> >             the de-facto way of refering to key sizes)
> >
> >         Raises KeySizeError if the size is invalid

   As purely a minor style issue, I'd rather see the actual default key
size in the method signature, rather than None...


> This part looks good too...I'm not sure, but can the user decide which
> symmetric algorithm to use with an asymmetric algorithm?  I think so...if
> so, there needs to be a variable that defines this.  Should it be an
> instance of one of the symmetric modules or should it just be the name of
> the module?

   I'd go with an instance - that way the implementation is completely open
to us stuffing any old instance object into the algorithm. Just define the
interface.


> I think it's a great start!  I'll take this initial pseudo code and come up
> with some actual Python code that matches this and post it on the web.  All
> who care can download it and make comments.

   Yay! :)



      Richard

--
Richard Jones
richard at bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)





More information about the python-crypto mailing list