[PYTHON-CRYPTO] SIG thoughts.

Michael Ströder michael at STROEDER.COM
Sat Feb 10 18:46:32 CET 2001


Bryan Mongeau wrote:
>
> aes = crypto.find_alg("aes",*args)
> would be better?

Yes. If find_alg is a factory it should pass additional parameters
to the class' __init__() method during object creation.

> Secondly, what if multiple implementations of a given cipher
> exist on a computer? Example, joe average installs a crypto device but
> is unaware that he is using the C implementation because it was found
> first.

Should be matter of local policy either defined in a global config
file by a system administrator knowing what to do or defined...

> Could a search parameter be added?

...at run-time by a search parameter specifying the unambiguous name
of the implementation (definition of used name space required).

> > Yes, for type-checking in debug mode. It should not be possible for
> > an application to use a RSA key for a AES cipher. I want to check
> > that with assert isinstance() statements.
>
> This is an excellent idea that I concurr with completely! Is the goal to
> protect lay programmers from their own mistakes?

Mainly it's meant to protect myself. ;-)

> > That's why I propose a dynamic registration of implementations. You
> > can distribute only the modules needed then. And you can choose the
> > implementations which fits your needs best.
>
> Maybe I don't know enough on the issue, but I don't see how the dynamic
> registration would be possible to effectuate efficiently.

Mainly only creating an instance of e.g. an cipher algorithm object
is dynamic. Your application should off course re-use this cipher
object to be more efficient.

Ciao, Michael.





More information about the python-crypto mailing list