Techniques for using a class loader to protect mobile code against a
malicious host. The techniques include using the class loader to extend a
class used by the mobile code such that a method is added to the code
which authenticates the mobile code. When executed, the method provides a
dynamic watermark that authenticates the code. The method may be
encrypted until it is added to the code. One such method uses a static
watermark in the code to determine whether the code has been modified.The
techniques also include using a class loader to extend the class such
that obfuscated symbolic names in the program that correspond to symbolic
names defined by the class can be resolved. A way of doing this is to
include a first association between the obfuscated symbolic names and
encrypted forms of the corresponding symbolic names in the program and to
make a second association between the encrypted forms of the
corresponding symbolic names and information used to resolve the symbolic
names defined in the class. The loader then uses the first and second
associations to resolve the obfuscated names.The class extension
techniques may be combined with obfuscation of names defined in the
program and static watermarking to provide layered protection of the
mobile code. The obfuscation and definition of the first association are
done prior to execution of the program and the class extension is done on
execution of the program. The disclosed techniques are particularly
well-adapted for use with the byte codes produced by Java language
compilers from Java language programs.