Decryption of truncated data?

David Shaw dshaw at
Sat Oct 16 15:22:23 CEST 2004

On Fri, Oct 15, 2004 at 06:09:22PM +1000, Pip Jones wrote:
> Is it possible to decrypt a data block which has the first 43 bytes 
> missing?!
> I inherited a wrapper script which was removing the PGP headers and 
> footers using hard-coded string lengths, but after a GPG upgrade, the 
> headers changed length and this part of the data was truncated. I've now 
> got lots of small data blocks (around 1k) I need to decrypt.
> I know this is unlikely due to the damaged structure of the encrypted 
> data, CRCs, etc. but is there any way of recovering the partial 
> remaining data?

Unfortunately, if you lost 43 bytes into a message, you lost part of
the session key.  You won't be able to decrypt without the session

However, are we talking about ASCII armored messages (i.e. "BEGIN PGP
MESSAGE", etc) ?  If so, then 43 bytes in may not even have touched
the actual message data.  It depends on how big the headers are.  The
default GnuPG headers are longer than 43 bytes.


More information about the Gnupg-users mailing list