OK. That’s done

 

I m compressing first encrypting second

 

Next question: I m compressing 1Mb chunks at a time. 

Can I encrypt those chunks safely instead of waiting for the compression to 
finish and then encrypt it all ?

 

From: Cryptography-dev 
<cryptography-dev-bounces+momchil=bojinov.i...@python.org> On Behalf Of Paul 
Kehrer
Sent: Wednesday, September 30, 2020 12:14 AM
To: cryptography-dev@python.org
Subject: Re: [Cryptography-dev] private_key.decrypt painfully slow

 

Yes, you want a hybrid encryption scheme here. Generate a symmetric key, use 
that to encrypt the payload, and encrypt the key itself under the public key.

 

Composing this in a safe manner is tricky though, so you may want to consider 
PyNaCl for this.

 

On Tue, Sep 29, 2020 at 4:03 PM <momc...@bojinov.info 
<mailto:momc...@bojinov.info> > wrote:

Hello,

 

New guy.

 

Not much of a python dev but I managed to put together some code to 
encrypt/decrypt files using RSA

But like the entire fine, not just some intermediate password

 

public_key.encrypt of 11 Mb ( ~47 000 * 190 byte pieces) file took about 8 
seconds

private_key.decrypt of the same file took 143 seconds

 

profiler said 142 of those came from _openssl.EVP_PKEY_decrypt

 

I m running x64 Python version 3.8.5

And I just installed the cryptography module today through pip

 

Am I being stupid trying to do this and not go with asymmetric encryption for 
the intermediate and go symmetric from there ?

 

Regards,

Momchil 

_______________________________________________
Cryptography-dev mailing list
Cryptography-dev@python.org <mailto:Cryptography-dev@python.org> 
https://mail.python.org/mailman/listinfo/cryptography-dev

_______________________________________________
Cryptography-dev mailing list
Cryptography-dev@python.org
https://mail.python.org/mailman/listinfo/cryptography-dev

Reply via email to