RSA in python

Heikki Toivonen heikki at osafoundation.org
Fri Feb 17 18:20:52 EST 2006


Abhisek Datta wrote:
> I am looking for good RSA implementations in python that can import a
> public key in PEM format and encrypt a buffer using the imported
> public key. I tried m2crypto, but somehow it is giving me exceptions
> which I couldnt solve as of now.

What you are trying to do should be covered by M2Crypto. Without more
context for the error (what was the file you were trying load, etc.) it
is hard to say what is wrong. My first guess is that your pem file did
not include the BEGIN/END lines.

I would suggest you take a look at the tests and samples included in
M2Crypto. They do show how to work with PEM files.


M2Crypto 0.15: http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto



More information about the Python-list mailing list