OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

opendocument-users message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [opendocument-users] Understanding "STORED" files


Brad Hards scripsit:

> Except I need to de-compress the resulting file. I see:
> "Each file that is encrypted is compressed before being encrypted. To allow 
> the contents of the package file to be verified, it is necessary that 
> encrypted files are flagged as 'STORED' rather than 'DEFLATED'. As entries 
> which are 'STORED' must have their size equal to the compressed size, it is 
> necessary to store the uncompressed size in the manifest. The compressed size 
> is stored in both the local file header and central directory record of the 
> Zip file."

It sounds like what you get after decryption is a headerless gzip file.  But
since the compression is not visible to zip, the uncompressed length (which is
part of the gzip footer) is stored elsewhere.  

The simplest gzip header is 0x1F 0x8B 0x08 0x01 0x00 0x00 0x00 0x00 0x00 0xFF.
Then comes the compressed data followed by the CRC-32 and the uncompressed
size, both represented as 32-bit little-endian values.

This is only a guess.  See http://www.ietf.org/rfc/rfc1952.txt for details
on the gzip format.

-- 
John Cowan  www.ccil.org/~cowan  www.ap.org  cowan@ccil.org
Mr. Henry James writes fiction as if it were a painful duty.  --Oscar Wilde


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]