CMSC 414 Fall 2001
Homework #1
Due September 11, 2001
All files must be checked into your repository by 11:00 am EST
ALL homework (written and programming assignments) will be submitted via the concurrent versioning system (CVS). Each student will be provided with a UNIX shell account on the UNIX system peking.missl.cs.umd.edu. These your account name and initial password will be emailed to you. A CVS repository will be automatically created under this account.
Access to your account on peking.missl.cs.umd.edu is via the secure shell (SSH) only. telnet and ftp service are disabled. SSH provides a similar environment to telnet, and scp provides a method to copy files back and forth between hosts over the network. Here is more information on how to use and find clients for CVS and SSH:
SSH HOWTO at http://www.csua.berkeley.edu/ssh-howto.html
A great deal of information on available clients and how to use cvs is provided at the site http://www.cvshome.org. You can also find detailed information on how to use cvs at http://www.linuxdoc.org/HOWTO/CVS-RCS-HOWTO.html.
Quick tutorial on how to use SSH and CVS. There are a number of benefits to using cvs to individual programmers. The biggest is that it allows you to maintain a series of versions of your software. This way you can always "back-up" to a previous version. Get into the habit of checking in your changes after major changes. Also note, you don't need to know all of the bells and whistles of cvs to take advantage of this benefit. Knowing just three or four commands is sufficient. The additional benefit of using a cvs repository is that they usually reside on server machines that are backed up to tape on a daily basis. Freeing you from worrying about disk crashes etc.
1. Download and install a clients for both ssh and cvs on your machine. If you're running on a UNIX machine, these will probably already be there. If you're on a windows machine, then you may have to download the clients from one of the links above.
2. Set your environment variables:
UNIX (bash)
export CVS_RSH=<path to>/ssh
export CVSROOT=<your username on peking>@peking.missl.cs.umd.edu:/home/<your username>/cvsroot
Windows
set CVS_RSH=<path to>\ssh.exe
set CVSROOT="<your username on peking>@peking.missl.cs.edu:/home/<your username>cvsroot"
3. Create the project for homework 1. You MUST use this project and directory name.
a. create a directory entitled homework1
b. cd into homework1
c. create your initial files with your favorite editor, e.g. hw1.java and hw1.txt
d. Now add the files to the repository:
cvs import -m "HW1 sources" cmsc414/homework1 cmsc414 starte. Now verify it worked (NOTE: diff will only work on UNIX):cd .. $ cvs checkout cmsc414/homework1 $ diff -r homework1 cmsc414/homework1f. If all is well, you can delete the original directory and continue work in cmsc414/homework1.g. check in your changes while in the directory cmsc414/homework1 with:cvs commit
Written Problems
Note: Several of the programming problems will assist you in this assignment.
Place all answers to these problems in a file named hw1.txt under the homework1 directory.
1. (problem #1 from page 269 of the text) A cryptographer once stated that cryptography could provide complete security, and that other security controls were unnecessary. Why is he wrong? (HINT: Think of the implementation of a secure system, and ask yourself what aspect(s) of the implementation cryptography can not protect.)
2. (problem #2 from page 269 of the text) Decipher the following text produced by a caesar cipher: TEBKF KQEBZ LROPB LCERJ XKBSB KQP
3. (problem #3 from page 269 of the text) If one-time pads are provably secure, why are they so rarely used in practice?
4. (problem #6 from page 269 of the text) Let k be the encipherment key for a caesar cipher. The decipherment key differs; it is 26-k. One of the characteristics of a public key system is that the encipherment and decipherment keys are different. Why then is the caesar cipher a classical cryptosystem, not a public key cryptosystem? Please be specific?
5. (problem #7 from page 269 of the text) The following was enciphered with a Vigenere cipher. Please find the key and decipher it, and explain the process you used to solve the system. NOTE: A solution without an explaination will not receive any credit.
TSMVM MPPCW CZUGX HPECP RFAUE IOBQW PPIMS FXIPC TSQPK
SZNUL OPACR DDPKT SLVFW ELTKR GHIZS FNIDF ARMUE NOSKR
GDIPH WSGVL EDMCM SMWKP IYOJS TLVFA HPBJI RAQIW HLDGA
IYOUX
6. Solve for the plaintext of the following ciphertext, and explain the process you used to solve the system. NOTE: A solution without an explaination will not receive any credit.
R NGPGMP PAG RNGZ HY EKHURFE HCN LQP UAGF WHQ OHFMRNGK PAG
ZCPGKFZPRTGM RP KGZCCW RMFP MH LZN ZYPGK ZCC
7. Solve for the plaintext of the following ciphertext, and explain the process you used to solve the system. NOTE: A solution without an explaination will not receive any credit.
EQVWG GVRWP LBSEY CIAXW FRHRF LLFIH UWTRK EHNCB RXAJR
JMLVI CEDWM FZZLZ HTVFV NLBJK TWFZT TGQBF LAIPI WYDKI
DQAOW KLFIY VFWAV ISEWM SKMYR LAIDA BNDES LDDVU GMTE
Programming Problems
NOTE: You MUST use a java SDK of 1.3 or above.
1. Write a java program that computes a frequency analysis of a given text file. Name your file freq.java.
2. Write a java program that computes the index of coincidence for a given ciphertext file. Name your file ic.java.
3. Write a java program that decimates a given ciphertext file into separate alphabet streams. Name your file deci.java.
4. Write a java program that uses kasiski's method to identify the number of alphabets (vigenere cipher) used to produce a given ciphertext file. Name your file kas.java.