EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Open PGP fails with non seekable stream

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#11159
Posted: 09/28/2009 11:33:06
by Allister Green (Standard support level)
Joined: 10/10/2008
Posts: 6

I am attempting to use the TElPGPWriter to encrypt a stream. This works fine if the stream is a simple filestream, but if I pass it a stream that is not seekable it fails as it attempts to call the Length property on the source stream.

If for example the source stream is a compressed stream this will fail as the length of the stream will not be known until all the data has been processed.

Is there any way to make this work?
#11160
Posted: 09/28/2009 11:50:01
by Eugene Mayevski (EldoS Corp.)

Yes, copy the source stream to memory or temporary file.


Sincerely yours
Eugene Mayevski
#11165
Posted: 09/28/2009 14:39:59
by Allister Green (Standard support level)
Joined: 10/10/2008
Posts: 6

Copying the source stream to memory is not an option as I want to use a Stream to minimise the amount of memory I use. Likewise, writing to a temporary file doesn't seem an appropriate or scalable approach either.

In general the streaming model allows for streams to wrap streams to achieve multiple transforms within a single operation. Is there any way for the PGPWriter to not require the use of the Length property? Can it not just read from the stream until it reaches the end?
#11168
Posted: 09/28/2009 23:52:03
by Ken Ivanov (EldoS Corp.)

I am not sure if it is technically possible at all according to OpenPGP specification. Each OpenPGP data packet must be prefixed with encoded length of the processed data, so knowing the length is required to process the data. Mykola will correct me if I am wrong.
#11171
Posted: 09/29/2009 03:25:43
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

OpenPGP specification allows such functionality (there is special case of packet size - 'partial', which allows to write PGP packets without knowing the exact length). So, I assume, we will consider adding such feature to OpenPGPBlackbox.
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.

Reply

Statistics

Topic viewed 1157 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!