469,613 Members | 2,028 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

Encryption large amount of data by using Asymmetric encryption.

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
Nov 16 '05 #1
1 5412
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.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Bart" <ba**@bart.it> wrote in message
news:eD**************@TK2MSFTNGP14.phx.gbl...
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


Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Harold Crump | last post: by
2 posts views Thread by Paul Fi | last post: by
13 posts views Thread by no game | last post: by
3 posts views Thread by The One We Call 'Dave' | last post: by
3 posts views Thread by Chuck P | last post: by
4 posts views Thread by pintu | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.