Assignments for Design and Analysis of Algorithms



  • TEST # 1

  • Review section 5.1, Sets, and complete problems 5.1-1, 5.1-4 and 5.1-5

  • Read section 5.4, Graphs, and become familiar with the terminology.
    Do problems 5.4-1, 5.4-3, 5.4-4 and 5.4-6

  • Review section 5.5, Trees.
    Do problems 5.5-4 and 5.5-5
    On pages 97-98 do problems 5-1a, 5-1c, 5-2a and 5-2b.

  • Read Chapter 6 sections 6.1 and 6.2.
    Do problems 1, 3, 4, 5, 6, 7, 9 and 10 on pages 104 - 105.
    Do problems 2, 3, (others to be announced) on page 109.

    Do the additional problems given here

  • Prog4 - Crypto encoder/decoder.
    In this assignment you are to write a program that will encode and decode messages. The program must do the following: For the purpose of this program you may embed the key in the program. Ordinarily this would not be the case. I.e., the key would be separate from the program and changeable by the user. You may create your own encryption algorithm or you may use a variation of the one that I will give below. If you create your own it may not be trivial. The Caesar cypher and its simple variations are considered trivial in this day and age. A good encryption algorithm has the property that others may know the algorithm (i.e. even have the source code) and, thus, be able to generate as many plaintext/encrypted message pairs as they desire and still not be able to decode encrypted messages without the key. The Caesar cipher does not pass this test. A good algorithm is also immune to the most common attacks such as frequency analysis. Thus, nearly all algorithms that use byte permutations should be avoided. A better algorithm has the additional property that it will be secure even if the attacker possesses many plaintext/encrypted message pairs all encoded with the same (current) key. Finally, the best algorithms possess all of the aforementioned properties and do not require the exchange of the decryption key. Public key systems meet this test.

    Here is a "reasonably good" encryption algorithm (we shall call it IGP) that is not too difficult to implement. Be aware that it does not even meet the better test given above so should not be used where secure communication is important.

    Exercise:
    Read the description of the IGP algorithm referred to above and see if you can determine how to "crack" it. You may assume that you have the source code to the program that encrypts and decrypts messages and that you have "many" plaintext/encrypted message pairs that use the currently active key. Two of the encrypted messages you have represent the same plaintext. You do not have the current key itself, obviously, but you have the ability to generate your own keys for testing purposes.
    Hint: First determine how to recognize the inserted garbage bits. Second, determine how to reduce the number of possible bits that a particular bit (say bit 0) could permute to.

    You may download a .EXE file that implements the above mentioned algorithm, together with a key file and a help file from cs-netlab-01.lynchburg.edu/courses/algorithms/crypto.

    The .EXE will run on your computer only if you have the required Visual Basic support files loaded. You may download an installation/setup collection of files by anonymous FTP to cs-netlab-01.lynchburg.edu. Move to the Algorithms subdirectory and then to the Cryptog subdirectory under that. Download the file Cryptog.zip, unzip it and run setup.exe.

  • TEST # 2





    Top of this page   Top of page      Home page   Home page