Re: gzip file ftp'ed as ascii...




aslanski2002@xxxxxxxxx wrote:
> Willem yazdi:
> > aslanski2002@xxxxxxxxx wrote:
> > ) aslanski2002@xxxxxxxxx yazdi:
> > )> Do not give up so fast. Yes we have a problem when we encounter CR or
> > )> LF, but excluding those two, all of the other bytes has been
> > )> transformed as they are. That's a valuable information. And when we see
> > )> CR+LF most of the times, it could be a LF (Unix text file case). If it
> > )> is a bytes in a binary file or in a header it could be CR or LF. If it
> > )> is critical data, it is worth giving a try!
> >
> > Still, there are 11000 locations that may or may not have been altered.
> > That's still a lot of info.
> >
> > Now, if the gzip format had, say, a crc every 32 kilobytes or so,
> > the story might be entirely different.
> >
> > ) I forgot to add that the last four byte of the file is the size of the
> > ) deflated data. So comparing it with the new size of the file we can get
> > ) some info about the number of CR and LF bytes in the original file! So
> > ) we can find out how many "CR/LF to CR+LF" substitutions occurred!
> >
> > Assuming there's roughly a 1/256 chance that a 0D is followed by a 00 in
> > the original, this extra information means that the number of ways to put
> > 00 bytes after 0D bytes is in the order of 40-choose-11000.
> >
> > That's still very roughly 500 bits of 'lost information'. Or, to put it
> > differently, 2^500 possible ways to try and put back a 00 after a 0D.
> >
> We have another useful information. It is a gzipped tar file. So the
> first 512 bytes is (or should be) a tar header with file name, file
> size and the CRC of the tar header. Using file size we can find out the
> position of the next tar header if we decode the header successfully.
> So when decoding the first file, possibilities are reduced! How many OD
> bytes would we have when we decode the first file in the tar archive
> for example?
>

Just to add that the "errors" may also be in the header part or even in
the CRC. Make sure you look at this possibility too.

SG

.



Relevant Pages

  • Re: gzip file ftped as ascii...
    ... Willem yazdi: ... size and the CRC of the tar header. ... position of the next tar header if we decode the header successfully. ... So when decoding the first file, ...
    (comp.compression)
  • Re: gzip file ftped as ascii...
    ... Sachin Garg yazdi: ... >> size and the CRC of the tar header. ... >> position of the next tar header if we decode the header successfully. ...
    (comp.compression)