edu.wisc.cs.stego.lib
Class RadixKEncoder
java.lang.Object
|
+--edu.wisc.cs.stego.Encoder
|
+--edu.wisc.cs.stego.lib.RadixKEncoder
- public class RadixKEncoder
- extends Encoder
Implements an Encoder object that outputs the data in a radix-k graph.
The value for k is specified as a parameter to the factory method or
can be taken as the default value.
For more information on radix-k graphs, see:
- Collberg and Thomborson. Software Watermarking: Models and Dynamic
embeddings. POPL 1999, 26th Annual SIGPLAN-SIGACT, pages 311-324.
Currently, this class allows the use of k between 2 and 36. If
this value is not specified in the job file, it defaults to 10. In the graph,
the least significant digit is represented first.
- See Also:
Encoder
,
edu.wisc.cs.stego.JobFile
Field Summary |
static int |
DEFAULT_RADIX
The default radix for the RadixK objects. |
static java.lang.String |
PARAM_ID
The name of the e-arg parameter in the job file which
specifies a radix. |
Constructor Summary |
protected |
RadixKEncoder(java.lang.String[] argv)
Builds a new RadixK encoder. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DEFAULT_RADIX
public static final int DEFAULT_RADIX
- The default radix for the RadixK objects.
PARAM_ID
public static final java.lang.String PARAM_ID
- The name of the
e-arg
parameter in the job file which
specifies a radix.
- See Also:
edu.wisc.cs.stego.JobFile
RadixKEncoder
protected RadixKEncoder(java.lang.String[] argv)
- Builds a new RadixK encoder. The argv array may optionally contain a single
element of the form:
radix=n
where n is a positive integer. If more than one argument is specified, this
constructor only considers the first.
- Throws:
- java.lang.IllegalArgumentException - if the first argument in the argv array is
invalid.
- See Also:
edu.wisc.cs.stego.JobFile
buildEncoder
public static Encoder buildEncoder(java.lang.String[] argv)
- This factory method builds RadixK objects. The argv array may optionally
contain a single element of the form:
radix=n
where n is a positive integer. If more than one argument is specified, this
constructor only considers the first.
- Parameters:
argv
- arguments to the encoder specified in the job file.- Returns:
- a newly instantiated RadixK object.
- Throws:
- java.lang.IllegalArgumentException - if the first argument in the argv array is
invalid.
encodeWMData
public WatermarkGraph encodeWMData(java.lang.String data)
- Computes a radix-k graph which encodes the specified data. The radix is
specified by the arguments to the factory method for this class. If none
are specified, the default is used.
- Overrides:
- encodeWMData in class Encoder
- Parameters:
data
- the message text to be encoded.- Returns:
- the adjacency matrix for the watermark graph.