Multiple Sym. Encrypted Packets

Emlyn Jones emlynj at
Tue Nov 7 15:50:45 CET 2006

I've written some code to generate an encrypted message which I can
successfully decrypt using gpg. Currently the packet stream contains
one Public-Key Encrypted Session Key Packet and one Symmetrically
Encrypted Data Packet and works perfectly. However, I would like to
set up the packet stream to contain multiple pairs of these packets.
When I try it gpg fails to correctly read the packet immediately
following the SED packet (it finds an invalid packet). Am I making
This works:
as does this:

This doesn't:
[PKESK][SED][PKESK][SED] (fails reading the second PKESK)

This will read the two PKESK packets and the first SED but not the final one:

I have two questions:
i)Should this be possible?
ii)Are there any tools  (other than gpg -vvv) to help debug what gpg
is finding in my packet stream?
iii)I'm pretty confident the size of the SED packet is specified
correctly but do I need to make sure that the SED packet size is a
multiple of the algorithm's block size?

Any pointers gratefully received.

More information about the Gnupg-users mailing list