manpagez: man pages & more
info lzip
Home | html | info | man

File:,  Node: Trailing data,  Next: Examples,  Prev: Stream format,  Up: Top

8 Extra data appended to the file

Sometimes extra data are found appended to a lzip file after the last
member. Such trailing data may be:

   * Padding added to make the file size a multiple of some block size, for
     example when writing to a tape. It is safe to append any amount of
     padding zero bytes to a lzip file.

   * Useful data added by the user; an "End Of File" string (to check that
     the file has not been truncated), a cryptographically secure hash, a
     description of file contents, etc. It is safe to append any amount of
     text to a lzip file as long as none of the first four bytes of the
     text matches the corresponding byte in the string "LZIP", and the text
     does not contain any zero bytes (null characters). Nonzero bytes and
     zero bytes can't be safely mixed in trailing data.

   * Garbage added by some not totally successful copy operation.

   * Malicious data added to the file in order to make its total size and
     hash value (for a chosen hash) coincide with those of another file.

   * In rare cases, trailing data could be the corrupt header of another
     member. In multimember or concatenated files the probability of
     corruption happening in the magic bytes is 5 times smaller than the
     probability of getting a false positive caused by the corruption of the
     integrity information itself. Therefore it can be considered to be
     below the noise level. Additionally, the test used by lzip to
     discriminate trailing data from a corrupt header has a Hamming
     distance (HD) of 3, and the 3 bit flips must happen in different magic
     bytes for the test to fail. In any case, the option '--trailing-error'
     guarantees that any corrupt header is detected.

   Trailing data are in no way part of the lzip file format, but tools
reading lzip files are expected to behave as correctly and usefully as
possible in the presence of trailing data.

   Trailing data can be safely ignored in most cases. In some cases, like
that of user-added data, they are expected to be ignored. In those cases
where a file containing trailing data must be rejected, the option
'--trailing-error' can be used. *Note --trailing-error::.

© 2000-2024
Individual documents may contain additional copyright information.