EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SBB PGP encryption with a source stream of unknown length

Posted: 12/17/2015 20:54:42
by Justin Cook (Basic support level)
Joined: 12/17/2015
Posts: 1

Hey guys,

I'm currently working on a project which requires that I pull data from a database and encrypt it to file without the data being written to a temporary file prior to encryption.

I don't know at the time of execution how many bytes of data will be read back from the database each time so I am unable to set the Count parameter to anything but 0 and my custom Stream implementation also can't provide an accurate Length until the source has been read fully.

I've tried returning a Length of 0 from the stream but it appears that TElPGPWriter will only ask for and encrypt a maximum of 1024 bytes in that case. I've also tried to return long.MaxValue on the assumption that I can return 0 bytes from the Read method when the source data has finished but TElPGPWriter seems to keep calling Read over and over ever when no more data is returned.

My custom stream is wrapping up a System.Concurrent.Collections.BlockingCollection<byte> internally in case that helps.

Is there any way we can get TElPGPWriter to either:
a) Poll the Length/Position of the Stream more than once so we can update those values to get the encryption process to finish early.
b) Respect the retrieval of 0 bytes from the Read method signifying an end of source stream.
Posted: 12/17/2015 21:07:49
by Eugene Mayevski (Team)

Thank you for contacting us.

I've moved your question to the HelpDesk as I'd like to discuss some confidential topics.

Sincerely yours
Eugene Mayevski



Topic viewed 1443 times

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


Back to top

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

Got it!