Lab 7 extra credit

In Lab 7, I mentioned giving extra credit if you wrote a cipher that guessed a shift amount for the cipher text based on letter and word frequencies in English. Here's a summary of the information I told you during lab time.

Copy the following files from the course public directory.

cp /homeemp/tvandrun/pub/235/Encrypto.class .
cp /homeemp/tvandrun/pub/235/Decrypto.java .
cp /homeemp/tvandrun/pub/235/mystery* .

Encrypto is a program I have written for you which will encode a text file using a random key. At the commandline, give it the name of a text file and the name of a file you want to contain the encrypted version. For example, if you have a file named somefile.txt, then running

java Encrypto somefile.txt somefile.cph

will produce a file called somefile.cph which will contain the encrypted text.

The file Decrypto.java is a partially written class for you to finish. It already contains code to read in a file, storing the contents of the file as a string referred to by the variable cipherText. Finish this program so that it prints the deciphered version to the screen (on the first try, without any other human intervention).

The files mystery1, mystery2, and mystery3 are encrypted texts you can try to decode.

DUE: Labtime on Tuesday, Feb 27.


Thomas VanDrunen
Last modified: Wed Feb 21 16:34:02 CST 2007