call of non-function (type string) error

Kalle Svensson kalle at gnupung.net
Wed Apr 11 15:38:37 EDT 2001


Sez Graham Guttocks:
> >>> 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

Perhaps try
>>> cipherobj = cipher.new(KEY, cipher.CBC, IV)
or
>>> cipherobj = cipher.new(KEY, Crypto.CBC, IV)

I have no idea what module you're using, haven't read the previous messages
in the thread and so on.  This is just a guess...

Peace,
  Kalle
-- 
Email: kalle at gnupung.net     | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD
 [ Not signed due to lossage.  Blame Microsoft Outlook Express. ]




More information about the Python-list mailing list