Re: RSA in python

2006-02-21 Thread Heikki Toivonen
Abhisek Datta wrote: > -BEGIN RSA PUBLIC KEY- > MIGJAoGBALxi3tGXlSwRgn7/Km6mTSge+5ijQgIn3GvnZOeYyOo1DkubVtTaFj26 > GWtJo43MEe1a5UlWKJEOpbKVCr4AASfFj8YmmRewH4SXdZ+w1Bad8amyzL2h8F7J > wJojOnocSs6xDE7o86CpZRUlojBefanMdCpu074QFktE63OD1zBBAgMBAAE= > -END RSA PUBLIC KEY- > > Traceback (m

Re: RSA in python

2006-02-17 Thread Abhisek Datta
Hello, Here is some debugging output: --- pyKB-DEBUG: Connecting to http://192.168.0.2:8080/RPC2 pyKB-DEBUG: Initializing session: (sessionKey: ABCDEFGHIJKLMNO) pyKB-DEBUG: Received public key: -BEGIN RSA PUBLIC KEY- MIGJAoGBALxi3tGXlSwRgn7/Km6mTSge+5ijQgIn3GvnZOeYyOo1DkubVtTaFj26 GWtJo43

Re: RSA in python

2006-02-17 Thread Heikki Toivonen
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

Re: RSA in python

2006-02-17 Thread plahey
Looking at the api documentation again, it is possible that they want this: pubkey = open( 'pubkey.pem', 'rb' ).read() # binary read here? rsa = M2Crypto.RSA.load_pub_key(pubkey) Anyway, things to play with... -- http://mail.python.org/mailman/listinfo/python-list

Re: RSA in python

2006-02-17 Thread plahey
stupid question, but did you try: rsa = M2Crypto.RSA.load_pub_key( file("pubkey.pem") ) It is not clear from the documentation what they want for "file" (and because Python has no type declarations, you are left to guess...). May not work... just thought I would ask. -- http://mail.python.org/

Re: RSA in python

2006-02-17 Thread Abhisek Datta
I tried the ezPyCrypto which is basically a higher level wrapper to pyCrypto but it fails to import public key in PEM format. -abhisek On 17 Feb 2006 07:02:51 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Did you try this: http://www.amk.ca/python/code/crypto ? > > -- > http://mail.python

Re: RSA in python

2006-02-17 Thread [EMAIL PROTECTED]
Did you try this: http://www.amk.ca/python/code/crypto ? -- http://mail.python.org/mailman/listinfo/python-list

RSA in python

2006-02-17 Thread Abhisek Datta
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