Question
Create a program to encrypt and decrypt binary files using S-DES (Simplified DES) in the Cipher Block Chaining mode. The program takes the input of
Create a program to encrypt and decrypt binary files using S-DES (Simplified DES) in the Cipher Block Chaining mode. The program takes the input of an initial key and an initial vector, reads the plaintext or ciphertext from a file, conducts the encryption or decryption, and writes the resulting ciphertext or plaintext into a second file.
You can use any of your preferred programming languages and operating systems. If the programming language is not C/C++/Java/Python, you will need to demo your code on your own computer.
Your program must following the following input and output formats. Input Format: The program should take a command in the following format. (java) mycipher -m mode -k initial_key -i initial_vector -p plaintext_file -c ciphertext_file mode: can be only encrypt or decrypt initial_key: 10-bit initial key initial_vector: 8-bit initial vector plaintext_file: a binary (not text) file to store the plaintext ciphertext_file: a binary (not text) file to store the ciphertext
Output Format: The program should print output in the following format. k1=subkey 1 k2=subkey 2 plaintext=all bytes of the plaintext separated by blanks, starting from the first byte ciphertext= all bytes of the ciphertext separated by blanks, starting from the first byte Sample Screen Shot:
Sample Test Cases (attached in Canvas): mycipher -m encrypt -k 0111111101 -i 10101010 -p f1 -c f3
Sample Screen Shot: Administrator: Command Prompt 1.810116 - filct Eile2 C: ycipher -n encrunt -k 0111111181 - k1-01011111 k2-11111196 plaintext -08099901 90100011 iphertext-11118180 001011 C: k1=01011111 k2=11111100 plaintext=00000001 00100011 ciphertext=11110100 00001011 mycipher-m decrypt -k 0101010101 - 00000000-p f4-cf2 k1=00011011 k2=10101100 ciphertext=00000001 plaintext=01101000 where f1 is a binary file with two bytes 012316, PSP- Ele Projects Edit Search View formet Tools HTML_Settings Window Help D. SI Il CXPIMO L. 2.2 5001 0203 0405 0607 0909 000 0000 OEOT 0123456789ADDET 0223 COCOS 0 HEX Owe and f2 is a binary file with one byte 01.6. PSP Ele Projects at Search Yew Ford Tools HTM Settings Window Help 001 0203 0405 0607 0909 6108 OCOD DEF0123456789ABCDEF 00000000 ) H er Owne Decrypting the attached file cipher.jpx with the command "mycipher-m decrypt -k 1010010001 -1 10101010 -p plain.jpg -c cipher.jpx" will result in the following plain.jpg file. Sample Screen Shot: Administrator: Command Prompt 1.810116 - filct Eile2 C: ycipher -n encrunt -k 0111111181 - k1-01011111 k2-11111196 plaintext -08099901 90100011 iphertext-11118180 001011 C: k1=01011111 k2=11111100 plaintext=00000001 00100011 ciphertext=11110100 00001011 mycipher-m decrypt -k 0101010101 - 00000000-p f4-cf2 k1=00011011 k2=10101100 ciphertext=00000001 plaintext=01101000 where f1 is a binary file with two bytes 012316, PSP- Ele Projects Edit Search View formet Tools HTML_Settings Window Help D. SI Il CXPIMO L. 2.2 5001 0203 0405 0607 0909 000 0000 OEOT 0123456789ADDET 0223 COCOS 0 HEX Owe and f2 is a binary file with one byte 01.6. PSP Ele Projects at Search Yew Ford Tools HTM Settings Window Help 001 0203 0405 0607 0909 6108 OCOD DEF0123456789ABCDEF 00000000 ) H er Owne Decrypting the attached file cipher.jpx with the command "mycipher-m decrypt -k 1010010001 -1 10101010 -p plain.jpg -c cipher.jpx" will result in the following plain.jpg fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started