CS 431
Homework assignment #1

This homework assignment is due on Thursday, September 12. Late assignments will lose 10% of their value each day that they are late. Electronic submissions of homework are acceptable provided they are ASCII files with no encoding.
  1. The characters whose ASCII codes are 32-126 are printable characters, so it is natural to identify these with the plaintext alphabet P=Z95 by subtracting 32 from the character value. Write a program that will read a line of printable ASCII characters, and apply the Vigenere cipher to this file, using a block size of 4 characters. The program should be able to accept the following as inputs: The output of the program should be the corresponding encryption.

    Apply this encryption using the key (5,17,91,6) to the string

    We spend our time searching for security and hate it when we get it.
    
    Turn in a listing of your program (written in a language of your choice, but preferably C), and the output of your program for this input.
  2. Define a stream cipher by
                       
    P = Z  , C  = Z  , K = {(a,b): gcd(a,7)=1},  z = i mod 7, 
         7         7                              i
    
    and e (x) = (ax + b + z)  mod 7, where (a,b) is the key.
         z
    
    a) Using (5,2) as the key, compute the decryption of the message 1543246.
    b) If you know that some part of the plaintext is 31012, and this encrypts to give the ciphertext 55205, then derive as much as you can about the unknown key (a,b). What additional information do you need to derive the entire key?

Return to the CS431 page.