/** * Iding of a string in a wav file * * @author Pat Troy: troy AT uic DOT edu */ public class Lect430a { public static void main (String[] args) { System.out.println("Begin Java Exection"); System.out.println(""); // open/get the sound file to use // get the message to hide String message = ; // set all of the sample value in the sound object to even values (as opposed to odd) // for each sample value that is not even, subtract 1 from that sample value // place the bits (i.e. Binary Digits) from the string into the sound object for ( index = 0 ; index < message.length() * 8 ; index++ ) { // get the sample value at sample number index // get the bit value for the bit that corresponds with sample number index int characterNumber = index / 8; int bitPostion = index % 8; char ch = message.charAt(characterNuber); int asciiValue = (int) ch; int bitValue = getBinaryDigit (asciiValue, bitPosition); // add the sample value and the bit value together // store the result at the sample for sample number index } // save the sound object into a file. } public static int getBinaryDigit (int asciiCode, int BinaryDigitPosition) { // This method should divide the asciiCode by 2 as many times // as specified by the BinaryDigitPosition, // Then use the modulus operator % to find the remainder // of a division by 2. // This remainder value is the bit value that we want returned // by the method. } } // end of Template class