CMSC 414 Spring 2001
Homework #1
Due at the beginning of class 2/8/01






This assignment contains both written and programming assignments. The language for the programming assignments is Java- unless other arrangements have been made with the Professor.

The programming assignments MUST zipped together using WinZip or zip(1) into a file named hw1-NNNN.zip where NNNN are the last four digits of your student ID. The entire file must be emailed to cmsc414@cs.umd.edu as an attachment by 11:00 am (start of class) on 2/8/01. The solutions for the written problems should be turned into the instructor before class begins on 2/8/01.

NOTE: The programming assignments are designed to assist you in solving the written problems.

Programming Problems

  1. Write a program that computes the frequency distribution of an alphabet given ciphertext file. Your program should be invoked at the command line as follows:    java frequency <ciphertext filename>. The output of your program should look like Table 2-2 on page 30 of the text.
  2. Write a program that performs the Kasiski method for polyalphabetic cryptanalsis described on page 36 of your text. The input should be a ciphertext file as in the first problem. The outputs should be the streams of ciphertext (decimations) for each potential key length, e.g.

  3.                                                S31 = {c1, c4, c7, c10, ...}
                                                    S32 = {c2, c5, c8, c11, ...}
                                                    S33 = {c3, c6, c9, c12, ...}

                    Thus, the following ciphertext, XHFER ADWFE RDWOP, which has a kasiski distance of 3 would result in the following output:

                                                    S31 = XEDEW
                                                    S32 = HRWRO
                                                    S33 = FAFDP
     

  4. Write a program that computes the index of coincidence, see equation on page 39 of text, for a given ciphertext file.

Written Problems

    Solve for the plaintext of each ciphertext, and explain the process you used to solve the system. NOTE: A solution without an explaination will not receive any credit.

  1. BIV TQIH CJUXV MQXIVFG BDVFQ ABYVIXFZI QWHVF Q WZFGH YVQFZIX QIU Z TVFHQZIAO UBIH ZIHVIU YVQFZIX ZH Q GVTBIU HZSV (Gioacchimo Rossini)
  2. N LNM DEKE YBB RYW MKWNFI MG HEKLOYRE HEGHBE MG RG MDNFIL MDEW GOIDM MG DYQE LEFLE EFGOID MG RG UNMDGOM CW DYQNFI MG HEKLOYRE MDEC (H.S. Truman)
  3. LCKFH IFXGA IWLWK SLHST TLASD
    VFNGC SUDLT RWLHK IMAHF FZAKZ
    SCYDE GLWTF DRXLS LUMON LDCOH
    TAKSC EOYLL SYSQH BGUDP FALMV
    CZROH NHMGD LTRWL HKIMA HFFPO
    QBHAB AEBG

  4. YYHHD BVAFE UAWEC SNOWA KBQHG
    TGYQM IVFRC UAYEL UOPPV ISDHE
    UAPRI FSLKZ PEYKE ICUMA KDUSJ
    AZNRK XAVPW ASXMP CWMES FOIXP
    TRRYU NGLZV RYIHG YMGLW FETTP
    LHJML KJZNQ UMMGI IPOSE WCAME
    KGMT

  5. DUQLG EAWGR RQKUK LAVSJ SQOTA
    SLWCJ TMSTA FGDKR RMTSG DDLSI
    SMSEL GFLBZ STJNY ATBCL TMLEV
    APOCD AOZOM LOIKR RMODL ZEWVZ
    NSXOM DDIOC LRMAL ANDKV EWXID
    DDRUV RE