Watermarking a java source file?

Levi Pearson levipearson at gmail.com
Thu Sep 13 22:03:20 MDT 2012

On Thu, Sep 13, 2012 at 9:01 PM, S. Dale Morrey <sdalemorrey at gmail.com>wrote:

> Yeah but that's not quite what I meant.  I was thinking of encrypting a
> message or something that can't easily be ripped out of the code to say
> "This is a reviewer copy of the source code", or something along those
> lines.
It's pretty hard to apply a transformation to a source code file that can't
easily be removed but still allows the source code to function as source
code.  If it can still be read correctly by a parser for the language,
stripping your 'watermark' is just a parser/pretty-printer combo away!  If
it just needs to be readable without actually being usable as a program,
just export it as a PDF with a watermark and whatever digital protection
features pdfs have these days.  Seems like the sort of nonsense that would
go really well with crazy digital content protection schemes for
e-documents. :)

Probably what you ought to do if you want to be able to identify if someone
has tampered with it is digitally sign it via PGP along with your "This is
a reviewer copy of the source code" comment and make sure all distributed
copies are so signed. If anything turns up without a signature or that
doesn't pass validation, you'll know it was tampered with.


More information about the PLUG mailing list