program LFSR // Name: // PennKey: // Recitation: // // // Input: TOY word containing number of bits (max 16), word containing seed, padded // to 16 bits, word containing tap, two additional words that should not // be encrypted/decrypted then bits stored as 16-bit words of // 0x0000 or 0x0001 and terminated by 0xFFFF // Output: data stream encrypted/decrypted using the specified LFSR // Remarks: // ----------------------------------------------------------------------------- // NOTE TO STUDENT: The comments below suggest a possible approach to // implementing this program. They do not contain all the details, and // you may find it necessary or easier to add, subtract, or reorder // the steps. // read seed, seed length, and tap // print bits, seed, and tap to stdout // read and print two TOY words for image width and height // while (StdIn.readShort() != 0xFFFF) // read one bit // LFSR.step() // compute and print encrypted/decrypted bit // loop