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> 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
> 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