Encryption large amount of data by using Asymmetric encryption.

B

Bart

Dear all,

I would like to encrypt a large amount of data by using public/private keys,
but I read on MSDN:
"Symmetric encryption is performed on streams and is therefore useful to
encrypt large amounts of data. Asymmetric encryption is performed on a small
number of bytes and is therefore only useful for small amounts of data."
There is not possibility to do it? I have tried to encrypt a 300kB file by
RSA Algorithm, but I received always "Bad length"!

Thank you,

Bart
 
D

Dmitriy Lapshin [C# / .NET MVP]

Ciao Bart,

Split the file into small blocks and encrypt each block separately.

Still, do you really need RSA encryption for all the file? You can encrypt
the file with a symmetric algorithm, write the encrypted file and then
append the symmetric key in turn encrypted with RSA.
That's similar to how SSL works - symmetric "session" keys are exchanged
encrypted with RSA (or some other asymmetric algorithm, don't remember for
sure) and then all data exchange is done with symmetric encryption to
improve speed.
 

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

Top