CPSC 430 Programming Assignments
Symmetric Key Encryption

Implement a Stream Cipher: Due Wednesday, Feb. 2

Write a program in the programming language of your choice (available on cs - Java, C++, Python, PHP) that encrypts each bit of the plaintext by XORing it with a random bit generated by an 8-bit linear feedback shift register with a tap sequence of 7, 3, 0 (that is, it generates the feedback bit by XORing bits at index 7, 3, and 0). You must use bit operations for your implementation.

Your program should read in an 8-bit key (a string of 0s and 1s) that is the starting point for the LFSR and an arbitrary length string of 0s and 1s for the plaintext. The program needs to convert the strings to numeric values to perform the bit operations.

Implement the LFSR as a class. The constructor should take the key as a parameter. The class must provide a method to compute and return the next bit in the random stream (and change the state of the register).

Implement Simplified Data Encryption Standard (SDES): Due Friday, Feb. 4

Write a program in the language of your choice (available on cs) to implement the SDES algorithm as described in the handout. Implement SDES in a class that provides methods for both encryption and decryption. The class must have the following:

Test your program with a program that asks the user for the key and asks if the user wants to encrypt or decrypt, then asks for the 8-bit string to encrypt or decrypt. Print the result.

Extra Credit: Add a feature to your test program that allows it to take a string of characters to encrypt or decrypt.

Requirements