Runtime View
Embed and Extract Watermarks
The following sequence diagram describes the watermark embedding and extraction process of a
text watermark inside a cover text between a possible external customer application (App) that
uses the Innamark watermarker library.
Default configurations and the RawInnamarkTag as a special watermark type are used.
More details about the steps:
- Initialize the
PlainTextWatermarkerwith the default configuration (DefaultTranscoding,SeparatorStrategy.SingleSeparatorChar, and whitespaces forplacement)
Embed Watermark
- The app starts the watermark embedding by passing the
coverTextand thewatermark(both plain text as Strings) to the Innamark watermark library - The
watermarkis transformed from a text String into an array of Bytes - The
watermarkBytesare wrapped into aRawInnamarkTag, the default and most simple form of anInnamarkTag - A 1-Byte long tag is added before the watermark to create
taggedBytes - The
taggedBytesare the 1-Byte-long tag to indicate theRawInnamarkTag+ the watermark as Bytes, which is returned to thePlainTextWatermarkerfor further processing. - The
taggedBytesare passed to theDefaultTranscodingto encode it into the custom alphabet - The
taggedBytesare transformed into invisible whitespace characters based on the alphabet of theDefaultTranscoding - The resulting array of
invisibleCharsis returned, which is the encoded watermark as a sequence of similar looking whitespaces - The embedding of the watermark into the cover text starts by adding the separator character
based on the
SeparatorStrategyto indicate the start of the watermark - Loop through the cover text and replace every classical whitespace with the watermark space
chars from the
invisibleChars - Return the watermarked cover text as a
Resultto the customer application
Extract Watermark
- The app starts the watermark extraction by passing the
watermarkedText(cover text including watermark) to the Innamark watermark library - The
SeparatorStrategyis used to find all watermark occurrences in the text - Decode the
invisibleCharsof each watermark based on theDefaultTranscoding - Return the
taggedBytesfor each watermark, which includes the tag and watermark in Byte format - Select the most frequent watermark for further processing to ignore damaged or broken watermarks
- Parse the
taggedBytesby reading the 1-Byte-long tag to indicate the InnamarkTag type - Validate the tag depending on the
InnamarkTagtype (e.g., checking hashes), while it passes for theRawInnamarkTag - Return the validated and parsed
InnamarkTagfor further processing - Extract the watermark from the
InnamarkTagby removing the starting tag - Return the watermark as a
Resultto the customer application