[Matroska-devel] DRAFT: 2nd try at the new elements for compression/encryption

Moritz Bunkus moritz at bunkus.org
Fri Oct 17 09:50:42 CEST 2003


First of all: thanks for your input, especially Pamel. It was good I've
written the last mail, because it allowed me to think about it clearly
and see the deficiencies.

Here's my second attempt.

Preface: The last one had two drawbacks: relying on the order (minor)
and being totally insufficient for encryption (I usually know a lot
about encryption and was clearly too preoccupied when I wrote my last

So here I go again.

KaxTracks (old)
\+ KaxTrackEntry (old)
 \+ KaxContentEncoding (master, optional, multiple)
  \+ KaxContentEncodingOrder (UInt, mandatory, unique, single,
     default 0)
   + KaxContentEncodingScope (UInt, mandatory, single, default 0)
   + KaxContentEncodingType (UInt, mandatory, single, default 0)
   + KaxContentCompression (master, optional, single)
   \+ KaxContentCompressionAlgo (UInt, mandatory, single, default 0)
    + KaxContentCompressionSettings (binary, optional, single)
   \+ KaxContentEncryption (master, optional, single)
    + KaxContentEncryptionAlgo (UInt, optional, single)
    + KaxContentEncryptionKeyID (binary, optional, single)
    + KaxContentSignatureAlgo (UInt, optional, single)
    + KaxContentSignatureHashAlgo (UInt, optional, single)
    + KaxContentSignatureKeyID (binary, optional, single)
    + KaxContentSignature (binary, optional, single)

* KaxContentEncoding: A master containing the aforementioned
  children. Can be used multiple times. Order is NOT important :)

* KaxContentEncodingOrder: Tells when this modification was used during
  encoding/muxing. Starting with 0 counting upwards. The decoder/demuxer
  has to start with the highest order number it finds and work its way
  Default value is 0.
  This value has to be unique over all KaxContentEncodingOrder elements
  in the segment.

* KaxContentEncodingScope: Tell whether the frame contents, the track's
  private data or both have been modified in this way.
  0 - only the frame contents,
  1 - only the track's private data,
  2 - both
  Default value is 0.

* KaxContentEncodingType: Tells the kind of modification
  done. Predefined values:
  0 - compression
  1 - encryption
  Default value is 0.

Depending on the value of KaxContentEncodingType one of the following
masters is used.

* KaxContentCompression: Contains settings for compression.

* KaxContentCompressionAlgo: Names the compression algorithm
  used. Predefined values:
  0 - zlib (each frame's contents were compressed with the zlib library)
  1 - bzlib (each frame's contents were compressed with the bzlib
  Default is 0. 0 is NOT none - if no compression is used then there
  shouldn't be a KaxContentEncoding element present in the first place.

* KaxContentCompressionSettings: Settings that might be needed by the

* KaxContentEncryption: Contains settings for encryption and

* KaxContentEncryptionAlgo: Encryption algorithm used. Predefined
  0 - none
  1 - DES
  2 - 3DES
  3 - Twofish
  4 - Blowfish
  5 - AES
  Default value is 0.
  Here 0 IS 'none' because you might want to sign the contents but not
  encrypt them.

* KaxContentEncryptionKeyID: For public key algorithms this is the ID of
  the public key used to encrypt the data with. Only the owner of the
  corresponding private key will be able to decrypt this data.

* KaxContentSignatureAlgo: Signature algorithm used, if any. Predefined
  0 - none
  1 - RSA
  Default value is 0.
  Here 0 IS 'none' because you might want to encrypt the contents but
  not sign them.

* KaxContentSignatureHashAlgo: The hash algorithm used for the
  signature. Predefined values:
  0 - none
  1 - SHA1-160
  2 - MD5
  Default value is 0, although I don't know any signature algorithm that
  does not use a hash function. But let's stay flexible.

* KaxContentSignatureKeyID: The ID of the private key used to make this
  signature. All folks with the corresponding public key can check for
  its authenticity.
  Must be present if KaxContentSignatureAlgo is not 0.

* KaxContentSignature: The signature itself.
  Must be present if KaxContentSignatureAlgo is not 0.

EbmlIds: I don't know how robux choses his IDs, but I propose the
following ones:

 \+ KaxContentEncoding 0x6240, 2
  \+ KaxContentEncodingOrder 0x5031, 2
   + KaxContentEncodingScope 0x5032, 2
   + KaxContentEncodingType 0x5033, 2
   + KaxContentCompression 0x5034, 2
   \+ KaxContentCompressionAlgo 0x4254, 2
    + KaxContentCompressionSettings 0x4255, 2
   \+ KaxContentEncryption 0x5035, 2
    + KaxContentEncryptionAlgo 0x47e1, 2
    + KaxContentEncryptionKeyID 0x47e2, 2
    + KaxContentSignatureAlgo 0x47e3, 2
    + KaxContentSignatureHashAlgo 0x47e4, 2
    + KaxContentSignatureKeyID 0x47e5, 2
    + KaxContentSignature 0x47e6, 2

Please send comments/suggestions as soon as possible - I'd like to make
this permanent this weekend!

 ==> Ciao, Mosu (Moritz Bunkus)

More information about the Matroska-devel mailing list