Skip to main content

Trendmark

The watermarker library uses bytes as the watermark content. This approach is very flexible and allows almost any content to be inserted as a watermark. However, when extracting a watermark, it is necessary to know how to interpret the bytes. The information needed to correctly interpret the bytes can be included in the watermark at the cost of increasing the size of the watermark. This makes it possible to extract and interpret watermarks from unknown sources, as long as they follow a predefined specification. The Trendmark class creates and implements such a specification. The specification is documented below.

Overview

Trendmark uses the first byte of a watermark as a tag composed of 8 flags to indicate the format. This allows to parse and interpret the content of the watermark correctly as long as the watermark follows this specification. The table below lists all specified tags sorted by the amount and positions of set flags and explains their purpose. The flags carry the following meanings:

(1) Custom
(2) Compressed
(3) Sized
(4) CRC32
(5) SHA3-256
(6) Unused
(7) Unused
(8) Unused

Tag (in bin)Tag (in hex)Class nameMeaning
0000000000RawTrendmarkraw bytes without special encoding
--------
1000000080CustomReserved for custom Trendmark implementations
0100000040CompressedRawTrendmarkcompressed bytes
0010000020SizedTrendmarksize + raw bytes
0001000010CRC32TrendmarkCRC32 checksum + raw bytes
0000100008SHA3256TrendmarkSHA3-256 hash + raw bytes
0000010004---Unused---flag currently not in use
0000001002---Unused---flag currently not in use
0000000101---Unused---flag currently not in use
--------
0110000060CompressedSizedTrendmarksize + compressed bytes
0101000050CompressedCRC32TrendmarkCRC32 checksum + compressed bytes
0100100048CompressedSHA3256TrendmarkSHA3-256 hash + compressed bytes
0011000030SizedCRC32Trendmarksize + CRC32 checksum + raw bytes
0010100028SizedSHA3256Trendmarksize + SHA3-256 hash + raw bytes
--------
0111000070CompressedSizedCRC32Trendmarksize + CRC32 checksum + compressed bytes
0110100068CompressedSizedSHA3256Trendmarksize + SHA3-256 hash + compressed bytes

Details

In the following, each watermark is specified with the text Lorem Ipsum encoded in UTF-8 bytes (4c 6f 72 65 6d 20 69 70 73 75 6d) as example watermark content. All values are in hexadecimal format. The compressed variants use DEFLATE as compression algorithm (see RFC 1951). Compressing the example watermark content results in the bytes (f3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00), which is larger because the example content is too small to be effectively compressed. Only the content is compressed, potentially allowing to use the additional information to increase the watermark robustness.

RawTrendmark

tagraw bytes
004c 6f 72 65 6d 20 69 70 73 75 6d

SizedTrendmark

The size is calculated over the entire watermark.

tagsize in 32 bits little-endianraw bytes
2010 00 00 004c 6f 72 65 6d 20 69 70 73 75 6d

CRC32Trendmark

The CRC32 checksum is calculated over the entire watermark, replacing the bytes containing the checksum with null bytes.

tagCRC32 checksum little-endianraw bytes
107a 10 91 544c 6f 72 65 6d 20 49 70 73 75 6d

SizedCRC32Trendmark

The size and CRC32 checksum are calculated over the entire watermark, replacing the bytes containing the checksum with null bytes.

tagsize in 32 bits little-endianCRC32 checksum little-endianraw bytes
3014 00 00 00fa 33 c8 514c 6f 72 65 6d 20 49 70 73 75 6d

SHA3256Trendmark

The SHA3-256 hash is calculated over the entire watermark, replacing the bytes containing the hash with null bytes.

tagSHA3-256 hashraw bytes
0864 02 85 b2 7b 00 49 00 8b 05 f4 f5 ad 52 fe de 18 13 b4 3d 2f 71 79 dc b4 38 9c a0 1c 15 be b04c 6f 72 65 6d 20 49 70 73 75 6d

SizedSHA3256Trendmark

The size and SHA3-256 hash are calculated over the entire watermark, replacing the bytes containing the hash are replaced with zero-bytes.

tagsize in 32 bits little-endianSHA3-256 hashraw bytes
2830 00 00 0010 28 25 27 0b e9 43 10 cb 90 ed 27 93 1e 09 cb e6 13 ba bc f5 3b 08 fa 97 2a 1b 6b 1e e1 3b 8d4c 6f 72 65 6d 20 49 70 73 75 6d

CompressedRawTrendmark

Trendmark uses DEFLATE as compression algorithm (see RFC 1951).

tagcompressed content
40f3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00

CompressedSizedTrendmark

The size is calculated over the entire watermark. Only the content is compressed, potentially allowing to use the additional information to increase the watermark robustness. Trendmark uses DEFLATE as compression algorithm (see RFC 1951).

tagsize in 32 bits little-endiancompressed bytes
6012 00 00 00f3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00

CompressedCRC32Trendmark

The CRC32 checksum is calculated over the entire watermark, replacing the bytes containing the checksum with null bytes. Only the content is compressed, potentially allowing to use the additional information to increase the watermark robustness. Trendmark uses DEFLATE as compression algorithm (see RFC 1951).

tagCRC32 checksum little-endiancompressed bytes
5026 73 92 10f3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00

CompressedSizedCRC32Trendmark

The size and CRC32 checksum are calculated over the entire watermark, replacing the bytes containing the checksum with null bytes. Only the content is compressed, potentially allowing to use the additional information to increase the watermark robustness. Trendmark uses DEFLATE as compression algorithm (see RFC 1951).

tagsize in 32 bits little-endianCRC32 checksum little-endiancompressed bytes
7016 00 00 009c cd 71 1df3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00

CompressedSHA3256Trendmark

The SHA3-256 hash is calculated over the entire watermark, replacing the bytes containing the hash with null bytes. Only the content is compressed, potentially allowing to use the additional information to increase the watermark robustness. Trendmark uses DEFLATE as compression algorithm (see RFC 1951).

tagSHA3-256 hashcompressed bytes
4853 b6 c1 d7 0f 09 5a c9 b8 4a 52 c1 b4 85 48 f0 d6 09 88 aa 7f 78 dd fd 54 c2 21 df 8f 9f b1 29f3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00

CompressedSizedSHA3256Trendmark

The size and SHA3-256 hash are calculated over the entire watermark, replacing the bytes containing the hash are replaced with zero-bytes. Only the content is compressed, potentially allowing to use the additional information to increase the watermark robustness. Trendmark uses DEFLATE as compression algorithm (see RFC 1951).

tagsize in 32 bits little-endianSHA3-256 hashcompressed bytes
6832 00 00 00df bc 29 21 6d 94 3d 73 6b 73 19 86 4c a8 b7 58 00 23 7a 2e 53 ba 6c ea 49 4f d0 8e f9 47 9d 1bf3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00