Disappearing Cryptography: Information Hiding: Steganography & Watermarking, Second Edition

Appendix A: Java Mimic Code

Here is the source code for a Java version of the context-free grammar-based mimic functions described in Chapter 7. The code is Copyright 1997 by Peter Wayner, but you're welcome to use it as long as you obey all U.S. export laws and identify all changes as your own. At this point it is functional, but it could use a better random number generator, a mechanism for detecting run-on grammars, and a more efficient parser. You may find a number of other ways to improve it.

BitInput Interface

public interface BitInput {  public boolean nextBit();  public void startBitSource(String s);  public void startBitSource();  public boolean atEnd();    /// Returns true if everything has been outputted.}

CTMimicCentral Class

import java.applet.*;import java.io.*;import java.net.*;import java.awt.*;public class CTMimicCentral extends Applet {  TableSetter ts;  OutSpitter os;  MimicParser mp;  Label mainAnnounce;  Text Field inputLine,outputLine;<a name="634"></a><a name="IDX-320"></a>  TextArea outputMimic, inputMimic;    // The main part of the input  Button inMimic,outMimic;    // For getting to go.  boolean startedUp=false;  public void init(){    this.setBackground(Color.white);    ts=new TableSetter(getCodeBase());    os=new OutSpitter();    add(inputLine=new TextField("PUT MESSAGE HERE"));    add(outputLine=new TextField(""));    add(outputMimic=new TextArea(""));    //add(inputMimic=new TextArea(""));    add(inMimic=new Button ("Push for Mimicry"));    add(outMimic=new Button("Remove Mimicry"));    add(mainAnnounce=new Label("Loading Table. Please wait."));    ts.setAnnounceHere(mainAnnounce);    ts.run(); ...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Integrated Development Environment (IDE)
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.