call of non-function (type string) error

Graham Guttocks graham_guttocks at yahoo.co.nz
Wed Apr 11 15:13:59 EDT 2001


"Andrew Dalke" <dalke at acm.org> wrote:

> How about
> 
> CIPHER = "DES3"
> Crypto = __import__("Crypto.Cipher.%s" % CIPHER)
> cipher = getattr(Crypto.Cipher, CIPHER)

This get me a bit further thanks, but now there is a problem with
returning the ciphering object.

>>> CIPHER = "DES3"
>>> Crypto = __import__("Crypto.Cipher.%s" % CIPHER)
>>> cipher = getattr(Crypto.Cipher, CIPHER)
>>> cipherobj = cipher.new(KEY, CIPHER+".CBC", IV)

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.0/site-packages/Crypto/Ciphers.py", line 84, in
__init__
    self.instance = self.C_new(key,mode,IV)
TypeError: an integer is required


_____________________________________________________________________________
http://movies.yahoo.com.au - Yahoo! Movies
- Now showing: Dude Where's My Car, The Wedding Planner, Traffic..




More information about the Python-list mailing list