Seeking pure Python AES/RSA library compatible with OpenSSL

N

novosibirsk

Hello,

I am faced with the following problem:

0. In pure Python, encrypt some data using AES.
1. In pure Python, encrypt the key used in 0 with RSA, given a private
key in PEM format.

2. In C, using OpenSSL, decrypt the AES key from 0 using the public
key that corresponds to private key in 1.
3. In C, using OpenSSL, decrypt the data from 0 with AES key from 2.

Question --- is there a library I can use for steps 0 and 1?

Thanks!
 
P

Paul Rubin

0. In pure Python, encrypt some data using AES.
1. In pure Python, encrypt the key used in 0 with RSA, given a private
key in PEM format.
Question --- is there a library I can use for steps 0 and 1?

I know there are some AES libs around, try google. The libs
will be quite slow.

I think tlslite can do PEM decoding and PKCS1.5 encryption
(http://trevp.net/tlslite).
 
N

novosibirsk

I know there are some AES libs around, try google.  The libs
will be quite slow.

I think tlslite can do PEM decoding and PKCS1.5 encryption
(http://trevp.net/tlslite).

Yes, tlslite is the only pure Python library I found that deals with
PEM. The problem is OpenSSL doesn't want to decrypt data encrypted by
tlslite (RSA_public_decrypt(), RSA_PKCS1_PADDING).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top