I have another Question concernant PyCrypto's implementation of RSA: which encryption mode is it using? <div>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.</div>
<div><br></div><div>The same question applied for the Padding options. Can I choose between PKCS5Padding and PKCS1Padding ?</div><div><br></div><div>Thanks !<br><br><div class="gmail_quote">2010/11/12 François Santy <span dir="ltr"><<a href="mailto:francoissanty@gmail.com">francoissanty@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi everybody !<div><br></div><div>I'm currently working with pycrypto and I want to import public and private keys from DER files.</div>
<div>I found a piece of code that shows how to proceed, but it isn't working anyway !</div>
<div>Here is the code I'm using:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>f = file("./public_key.der")</div></div><div>
<div>key = RSA.importKey(f.read())</div></div><div><br></div></blockquote>It tells me <i>'module' object has no attribute 'importKey'. </i>It's rather strange since the method appears explicitely in the file /lib/Crypto/PublicKey/RSA.py<i>.</i><div>
<i><br></i></div><div>What am I doing wrong ?</div><div><br></div><div>Thanks.<br><div><div><br>-- <br>François S.<br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>François S.<br>
</div>