CSC 440 Cryptology Questions
Description
Unformatted Attachment Preview
Assignment 5
Winter quarter, 2023
All references to the textbook are to the 3rd edition! Please make sure you are using it.
Reading
In the textbook, please read sections 7.2 and 7.3, chapter 9, and chapter 10.
Programing
You are to write a program that Implements encryption in simplified DES system described in section
7.2. The program will consist of at least two methods.
–
–
encrypt(plaintext, key): The plaintext is an integer in the range 0 to 4095 (12 bits) and
the key an integer in the range 0 to 511 (9 bits). It returns the ciphertext, which is a 12-bit
integer.
a main method or section that prompts the user for a plaintext value and a key value and then
prints the ciphertext.
A good approach to writing this is to implement each step in a round as a method. To support this, here
is the pseudocode for the various steps along with a method for creating the key schedule. Note that all
variables and parameters are of type integer.
generateKeySchedule(key)
subkeys = integer array of length 4
subkeys[0] = (key & 0b111111110) >> 1;
subkeys[1] = ((key & 0b011111111) > 9);
subkeys[2] = ((key & 0b001111111) > 8);
subkeys[3] = ((key & 0b000111111) > 7);
return subkeys
expand(r)
bit1 = (r & 0b100000) >> 5
bit2 = (r & 0b010000) >> 4
bit3 = (r & 0b001000) >> 3
bit4 = (r & 0b000100) >> 2
bit5 = (r & 0b000010) >> 1
bit6 = (r & 0b000001) >> 0
expandedR = (bit1 0
s1 = s1box(rLeft4bits)
s2 = s2box(rRight4bits)
return (s1
Purchase answer to see full
attachment

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."