Copyright watermarking of Java .class files.
William Overington
Copyright 2002 William Overington
Tuesday 5 February 2002
In January 2002 I started a new thread in the discussion forum at http://forum.mhp.org entitled "Copyright watermarking of Java .class files.". That was on a Thursday evening. Subsequently, on the following Saturday afternoon, I added another posting to the thread. As it happened, no one else posted to that thread.
I thought that it might be interesting to add a transcript of those postings into this sequence of documents.
2002/01/03 18:21
Programmers who write in Java might like to know of a
technique that I have devised for including a copyright message
within a Java .class file. I have started including in the Java
source code of Java programs that I write a globally declared int
variable that contains within the name of the variable itself a
copyright notice.
2002/01/05 14:27
It has occured to me that this copyright watermarking
of Java .class files could also be used from within a content
authoring package, if the manufacturer of the content authoring
package chooses to include the facility for end users of the content
authoring package.
Copyright 2002 William Overington
This file is accessible as follows.
I devised the method last year and have
just started using a new version for 2002.
I presently use
the following.
int
____Copyright_2002_William_Overington____=2002;
This int
variable is not used within the program at all. However, including
this int variable as a global variable produces the effect that if
the .class file is opened in a text editor, then my copyright notice
appears in text upon the screen.
The four underscore
characters at each end of the name of the variable produce the
effect of distinguishing the copyright message from other characters
that might be displayed as the text editor seeks to display the
object code in the Java .class file as if it were meaningful text.
If someone were to seek to erase the copyright message thus
produced into the .class file, then that action would spoil the
security verification of the Java .class file.
Thus, one
line of code in some Java source code can produce a sort of
"copyright watermark" in a Java .class file.
I feel that
this is a useful way to include a copyright message in a Java .class
file.
William Overington
3 January 2002
For example, suppose that such a content
authoring package were running on a PC with a Visual Basic style
graphical user interface style display. There could be a checkbox
labelled with a message such as follows.
Include copyright
watermark in Java .class files.
There could be a textbox
below and to the right of the checkbox and if the checkbox is
checked, then the text in the textbox is used as the name of a
globally defined int variable within the Java .class files that are
produced. The content authoring package could perform a test on the
text that had been entered by the end user into the textbox to
ensure that the text entered constituted a syntactically valid Java
identifier name and that that name did not clash with the name of
another identifier used within the Java program produced by the
content authoring package.
In this manner, the benefits of
using copyright watermarking of Java .class files could be made
available to users of content authoring packages as well as to
people who are able to code Java programs directly.
William Overington
5 January 2002