Step 5 - Introduction to Watermarks

Files located in the tutorial/step5/files directory:
mousegestures-1.2.jarMouse Gestures library jar
test.jarJar with mouse gestures demo frame
RunAllatori.batRuns Allatori Obfuscator
config.xmlAllatori configuration file
ExtractWatermark.batRuns Allatori's watermark extracting class
ExtractWatermark.xmlConfiguration file for extracting a watermark
Clean.batDeletes generated files


Here we will learn to use watermarks.

Let's look what have changed in the configuration file, changes are in bold:

<config>
    <jars single-jar="single.jar">
        <jar in="test.jar" out="obf-test.jar"/>
        <jar in="mousegestures-1.2.jar" out="obf-mousegestures-1.2.jar"/>
    </jars>

    <keep-names>
        <class template="class *.TestFrame"/>
    </keep-names>

    <property name="log-file" value="log.xml"/>

    <watermark key="secure-key-to-extract-watermark" value="Customer: John Smith; Date: xx.yy.zzzz"/>
</config>

We have added a watermark element with the following attributes:
key - the key that is used to embed a watermark into the application using steganography techniques;
value - any string that will be embedded into the application jars. It can be such information as copyright, customer name, company name or any other information that uniquely identifies the build. A watermark can be used to identify owners of the software or track the origin of a pirated copy.

To extract the watermark we need another configuration file:

<config>
    <jars>
        <jar in="single.jar"/>
    </jars>

    <watermark key="secure-key-to-extract-watermark"/>
</config>

We specified the jar file that contains the watermark and the key for the extraction. The key should match the key used for embedding. If you specify wrong key the watermark wouldn't be extracted.

Run ExtractWatermark.bat to see the extracted watermark.

Step 4       Step 6       Contents