[pycrypto] RSA importKey

Dwayne C. Litzenberger dlitz at dlitz.net
Mon Nov 29 22:14:38 CST 2010


Hi François,

PyCrypto doesn't currently have any RSA padding support; it merely provides 
the RSA modular exponentiation primitive.

Actually, the whole Crypto.PublicKey API is a minefield.  It's 
overgeneralized, and it almost never does what you would expect it to do.  
I'd love to see proposals a well-designed replacement API that doesn't add 
a ton of complexity.

Cheers,
- Dwayne

On Fri, Nov 12, 2010 at 02:32:45PM +0100, François Santy wrote:
>I have another Question concernant PyCrypto's implementation of RSA: which
>encryption mode is it using?
>I had to use PyCrypto's implementation of DES recently, and I could easily
>choose between several modes (MODE_EBC, MODE_CBC,...), but unfortunatly, I
>can't find these modes in RSA.
>
>The same question applied for the Padding options. Can I choose between
>PKCS5Padding and PKCS1Padding ?
>
>Thanks !
>
>2010/11/12 François Santy <francoissanty at gmail.com>
>
>> Hi everybody !
>>
>> I'm currently working with pycrypto and I want to import public and private
>> keys from DER files.
>> I found a piece of code that shows how to proceed, but it isn't working
>> anyway !
>> Here is the code I'm using:
>>
>> f = file("./public_key.der")
>> key = RSA.importKey(f.read())
>>
>> It tells me *'module' object has no attribute 'importKey'. *It's rather
>> strange since the method appears explicitely in the file
>> /lib/Crypto/PublicKey/RSA.py*.*
>> *
>> *
>> What am I doing wrong ?
>>
>> Thanks.
>>
>> --
>> François S.
>>
>
>
>
>-- 
>François S.

>_______________________________________________
>pycrypto mailing list
>pycrypto at lists.dlitz.net
>http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto


-- 
Dwayne C. Litzenberger <dlitz at dlitz.net>
   OpenPGP: 19E1 1FE8 B3CF F273 ED17  4A24 928C EC13 39C2 5CF7


More information about the pycrypto mailing list