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 tag 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 and explains their purpose. The tags are counted upwards from 0 for watermarks that add additional content and downwards from fe for watermarks that change the content itself (e.g. compression).

Tag (in hex)Class nameMeaning
00RawTrendmarkraw bytes without special encoding
01SizedTrendmarksize + raw bytes
02CRC32TrendmarkCRC32 checksum + raw bytes
03SizedCRC32Trendmarksize + CRC32 checksum + raw bytes
04SHA3256TrendmarkSHA3-256 hash + raw bytes
05SizedSHA3256Trendmarksize + SHA3-256 hash + raw bytes
------
feCompressedRawTrendmarkcompressed bytes
fdCompressedSizedTrendmarksize + compressed bytes
fcCompressedCRC32TrendmarkCRC32 checksum + compressed bytes
fbCompressedSizedCRC32Trendmarksize + CRC32 checksum + compressed bytes
faCompressedSHA3256TrendmarkSHA3-256 hash + compressed bytes
f9CompressedSizedSHA3256Trendmarksize + SHA3-256 hash + compressed bytes
------
ffCustomReserved for custom Trendmark implementations

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
0110 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
0287 0b 16 354c 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
0314 00 00 001e 85 5b 044c 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
04de 02 65 dd 6b 16 a0 b4 ab 05 a4 39 36 c0 73 12 4f 66 a2 aa 55 b3 9c 2b 30 b6 19 de 1c 11 c9 504c 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
0530 00 00 00f2 17 a5 ae 43 c5 70 a2 33 2b b5 90 60 23 45 da 6d 35 d3 34 95 5c 17 83 ec ec 2e 49 66 45 c9 1a4c 6f 72 65 6d 20 49 70 73 75 6d

CompressedRawTrendmark

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

tagcompressed content
fef3 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
fd12 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
fc9d 54 46 fff3 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
fb16 00 00 0013 07 a7 d2f3 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
fadf 60 19 45 c2 77 98 5d 0e 59 cc f8 9b 27 ed 9f 9c 98 85 a5 b3 3e c7 47 fa 88 68 74 a8 ef 77 5bf3 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
f932 00 00 00cc a9 b4 81 b5 3a 33 a4 b1 ee 7a e4 80 60 45 d2 66 e4 44 8a 41 d4 8d 5e c1 99 88 b2 ef 83 c8 6ef3 c9 2f 4a cd 55 f0 2c 28 2e cd 05 00