[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to use dmsetuup?



Hi,

David Christensen wrote:
> Are there tools other than xorriso(1) that can create a compatible checksum?
> Read the checksum?

Not yet. The data format is documented in
  https://dev.lovelyhq.com/libburnia/libisofs/raw/branch/master/doc/checksums.txt
For the general concept of AAIP attributes see
  https://dev.lovelyhq.com/libburnia/libisofs/raw/branch/master/doc/susp_aaip_2_0.txt
For the exact format of attributes "isofs.ca" and "isofs.cx" see
  https://dev.lovelyhq.com/libburnia/libisofs/raw/branch/master/doc/susp_aaip_isofs_names.txt

The implementation of this format in another program would be some work.
It would be much easier to link with libisoburn and to use its xorriso
API. Each xorriso command can be performed by a C function call. See
in /usr/include/libisoburn/xorriso.h the functions Xorriso_option_*().
Further there is Xorriso_interpreter() which performs commands and their
parameters given as text arguments. Xorriso_execute_option() splits a text
line into commands and parameters and performs them.

The way to get the MD5s of data files is an -exec action of command -find.
The MD5s must have been loaded at -indev time. So before -indev one has to
perform -for_backup or -md5 "on":

  xorriso -for_backup -indev /dev/sr0 -find / -exec get_md5 --

yields on stdout md5sum compatible lines of all MD5 equipped data files:

  bd8d516f33262f7d8ef3bf952729e671  /my/first_file
  90ae421ded24f03d6b7ae4d5bfdd41e9  /my/second_file
  ...

For the MD5 of just one particular file let -find start at that file

  md5_line=$( xorriso -for_backup -indev /dev/sr0 \
                      -find /my/second_file -exec get_md5 -- 2>/dev/null )


> My approach is *.md5 and *.sha256 sister files for each archive encrypted
> tarball file.

As we can see with xorriso's MD5s and the parity checksums of the medium,
it is always good to have own checksums (although i deem SHA256 overdone
unless protection against malicious manipulations is needed).


> implementing algorithms
> from standards is non-trivial; bugs are not uncommon.

Especially when the specs are sparse with describing the exact algorithm
and use nomenclature from the checksum community.
ECMA-337 (DVD+RW) lists four algorithms, which use three different
polynomials and a notation "RS(X,Y,Z)" which i don't know.

I once had to explore the checksum algorithms of ECMA-130 (CD-ROM)
annex A and B. Other than with DVD and BD, the CD commands of MMC let the
user supply own error correction data when a raw write mode is selected.
See the comments at the beginning of
  https://dev.lovelyhq.com/libburnia/libburn/raw/branch/master/libburn/ecma130ab.c
(which i don't really understand 14 years after i wrote them down).


Have a nice day :)

Thomas


Reply to: