EldoS | Feel safer!

Software components for data protection, secure storage and transfer

RSA Encryption and max length

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#2183
Posted: 02/06/2007 14:59:09
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

Hi, I'm just starting to use the TElRSAPublicKeyCrypto object to encrypt some data. If I give it a line of text with 136 characters in it to encrypt, it gives an error "SInputTooLong". Is this a fundamental issue with my understanding of public key encryption or something? Why can't I just give it a load of data and have it encrypted? I'm not expecting to actually have to give it more than about 250 characters, but I don't want to find it fails in a years time when I give it 251 or something.

Would there be any limit if I used streams instead of character buffers to encrypt? My code is all experimental at the moment. Or perhaps another public key algorithm instead of RSA?

All suggestions welcome. Thanks, Matthew
#2185
Posted: 02/06/2007 15:07:26
by Eugene Mayevski (EldoS Corp.)

Quote
matthew Jones wrote:
If I give it a line of text with 136 characters in it to encrypt, it gives an error "SInputTooLong". Is this a fundamental issue with my understanding of public key encryption or something?


Yes. Asymmetric encryption can be used to encrypt only small chunks of data (less than the key length). The actual data should be encrypted with a random (cryptographically strong) key using symmetric algorithm, then the password is encrypted using asymmetric algorithm.


Sincerely yours
Eugene Mayevski
#2188
Posted: 02/07/2007 06:50:02
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

Ah, okay. I'll work out how to do that then. I might even put together a "how to do it" demo since I seem to need step by step examples to put all the building blocks together. If I do, I'll let you have the source.
#2190
Posted: 02/07/2007 11:35:44
by Eugene Mayevski (EldoS Corp.)

That would be great, thank you


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 2198 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!