RSA in python
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

RSA in python

From: Abhisek Datta <abhisek.datta@gmail.com>
Date: Fri Feb 17 2006 - 15:49:52 CET

Hello,

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.

I get the following with m2crypto:
rsa = M2Crypto.RSA.load_pub_key("pubkey.pem")
gives me:
  File "KB_Client.py", line 63, in SessionInit
    rsa = M2Crypto.RSA.load_pub_key("pubkey.pem")
  File "/usr/lib/python2.4/site-packages/M2Crypto/RSA.py", line 225,
in load_pub_key
    return load_pub_key_bio(bio)
  File "/usr/lib/python2.4/site-packages/M2Crypto/RSA.py", line 237,
in load_pub_key_bio
    rsa_error()
  File "/usr/lib/python2.4/site-packages/M2Crypto/RSA.py", line 162,
in rsa_error
    raise RSAError, m2.err_reason_error_string(m2.err_get_error())
M2Crypto.RSA.RSAError: no start line

Any help will be highly appreciated.

Regards,
-abhisek
Received on Sun Apr 30 09:34:42 2006