CMSC 414 Fall 2002 Homework # 1 Due September 19, 2002 In order to receive credit, solutions still must be electronically SUBMITted by 12:00 Noon on the above date. Directions use of the SUBMIT program will be discussed in class on on Tuesday, September 17 and posted to the webpage before then. Written Exercises: (Doing the programming problems first will probably help you to solve the written problems. It's OK to use your programs to solve the written problems, but all steps must be explained in order to receive credit. "Computer programs says XXXX" is NOT an explanation) 1. (Problem # 6 from Chapter 9 of the textbook) Deciphering ciphertext generated by a Caesar cipher involves enciphering with a key which is different from the enciphering key. Why then is a Caesar cipher considered to be a classical cryptosystem instead of a public key cryptosystem. Be specific. 2. As discussed in class, one-time pads are provably secure but there are some logistical problems associated with their use. Give an example of a situation where a one-time pad can easily be used and an example where use of a one-time pad would be difficult to implement. (The example given in class is acceptable, but expand and fully explain why) 3. The following ciphertext is suspected to be the output of a Vigenere cipher. Solve for the plaintext, explaining all assumptions and showing each step. (Obtaining the correct plaintext without explaining the steps is NOT a correct solution, and will not receive any credit) Also keep in mind the class discussion on transcription errors when working these problems: fycpa lgvqq gqmfc odzjr joert tpdne jrlla njixo alfeq qvyxz wqbsy tphry mfofo lsrak iniva lglfs cllbn eozrg yvivo lsvbe ajfek haahf cqtqg lqody brtos cyrjr nchfu iopyk phdwn eowai jfzge pxxqy emwum usatf xhryy vifty qfvhs mqmmh qsfkq rnqfe ioyxj rvhwn wfjoe kuzbf hkfec uenwf ouakf twpps yvzfo mprbd srddm dldnx pwedk zklel ycggi clrto alycg vpchz ioixf kqrng xwwui lxvkw s (Robert Heinlein) 4. Please decipher the following ciphertext. Explain each step. (correct plaintext with no explanation is not an valid answer): Uiptf xip xpvme hjwf vq fttfoujbm mjcfsuz up qvsdibtf b mjuumf ufnqpsbsz tbgfuz eftfswf ofjuifs mjcfsuz ops tbgfuz (Ben Franklin) 5. Please decrypt the following cipher text. Show and explain all steps (correct plaintext with no explanation is not an valid answer): A HGWSIHLK C SSCIQE WPVU E KRKAR WCXTVDGD LRAY QEH ZKNQDX FAANVCT YEC D IPVUTC ICMEUZIT PANVC T VDG PVFTC Q WTR UIGCXY HTG WTCVYROS G SEN S OVTEPY EDVUP DSWZ OWBGV SEX OPMLRK P MTHTK YRFYS EBYKP NAGMC S PTY XVJT A YYWY OO EWZUG WXX IBSV OHTVD GSRU LMQX WKY AVSRX AHGZSJ ZID SPZ A YQPX YPSMSR UVFCDXR JKK ZMTR E FYRKOEEMS DWINO VZJOWVHY H VGZ MT REFYR RUYRB SXYAO REEK LKXKGYOIBED Programming Exercises: (You are encouraged to use Java, if you use Java you must use JDK 1.3 or above. In future assignments you may be required to use Java, and they may build on this assignment.) Submit the source code as well as an executable version using the "submit" procedure which will be detailed later. 1. Write a program which counts the instances of each letter in an input file (the default input file should be ciphertxt.txt) and performs a frequency analysis. You may ignore non-alphabetic characters and need not distinguish between upper- and lower-case letters. Name the source file tally.java (or .c, .cpp, etc if you are ignoring the above suggestions). Give total number of occurrences of each letter as well as expressing the frequency as a percent of the characters. Also output the total number of characters. Usage: java tally java tally input.file 2. Write a program to calculate the index of coincidence of provided ciphertext. By default the ciphertext will be in a file called ciphertxt.txt, but an option should be provided for specifying a different file from the command line . Name your source file ic.java (.c, .cpp, etc). Usage: java ic java ic input.file 3. Write a program that uses kasiski's method to determine the probable key period of a Vigenere cipher, stored by default in ciphertxt.txt. Name your source file kasi.java (.c, .cpp, etc). Usage java kasi java kasi input.file 4. Write a program to sort the ciphertext stream into individual alphabet streams (for use when applying Kasiski's method to a Vigenere cipher). Name your source file sort.java (.c, .cpp, etc). The number of streams should be a command line input, the source file shall be handled as in the above cases. Usage java sort NumStream java sort NumStream input.file