jmark: A lightweight tool for watermarking Java class files
hits
since 2002.1.9
OVERVIEW
"jmark" aims to easily identify illegal Java programs containing unlicensed class files. jmark provides a practical way for encoding and decoding a digital watermark into/from Java class files. Encoding a program developer's copyright phrase as a watermark ensures the legal ownership of class files.
DOWNLOAD
Below we provide C source code and binary files of the jmark.
The archive contains two tools: "jmark" and "jdecode".
"jmark" injects a watermark into a Java classfile.
"jdecode" decodes a watermark from a Java classfile.
The programs run on a variety of UNIX systems, MS-Windows, MS-DOS, etc.
Licensing conditions:
EXAMPLE
You should at first add a dummy method into your Java source code manually, and compile it, then use the "jmark" to inject your own watermark into the dummy method (to-be-watermarked method).
Here we have "TEST0.class" to be watermarked. "TEST0.class" contains 12 methods, and, the method No.10 is the dummy (actually never envoked). Below we encode "(C)AKITO MONDEN 2003" (this is the watermark phrase) into the dummy method. This example also specifies a key phrase "MyKey" to determine a bit assignment rule -- a mapping between character sequence (watermark phrase) and bit sequence (in Java byte code). Only the person who knows the key phrase (this case "MyKey") can decode the watermark correctly.
%jmark TEST0.class 10 "(C)AKITO MONDEN 2003" -k"MyKey" <--- Watermark encoding
#classfile: TEST0.class
#method: 10
#watermark: "(C)AKITO MONDEN 2003"
#key: "MyKey"
%jdecode TEST0.class -k"MyKey" <--- Watermark decoding
#classfile: TEST0.class
#key: "MyKey"
#begin{watermark}
1 "X(6B5"
2 "))BQBQB88IQB88IQJCJE7EQ QJ"
3 "X(2"
4 "J1RIAR"
5 ""
6 ""
7 "X(P6HXVN"
8 " (H6BX8,"
9 "MB28"
10 "(C)AKITO MONDEN 2003 (C)AK" <--- Watermark decoded from method no.10
11 "X(P6HXCE"
12 "XR7RIRXRQIBI"
#end{watermark}
Instead of specifying the to-be-watermarked method (dummy method) by its index number,
you can also specify the to-be-watermarked method by its name.
%jmark TEST0.class check_std "(C)AKITO MONDEN 2003" -k"MyKey" <--- "check_std" is the name of the to-be-watermarked method
Algorithm option:
-a0: Default watermarking algorithm
-a1: Redo encoding a character when overwriting operands
-a2: Not using "Replacing opcodes" (Using only "overwriting operands")
Algorithm a2 is more resistant to obfuscation attacks than a0 and a1.
CHANGE LOG
RELATED PUBLICATIONS
CONTACT
Akito Monden, Dr. Eng.
Associate Professor
Graduate School of Information Science
Nara Institute of Science and Technology
8916-5 Takayama, Ikoma, Nara, 630-0101, Japan
TEL +81-743-72-5312
FAX +81-743-72-5319
e-mail: akito-m<at>is.naist.jp
URL
http://se.naist.jp/~akito-m/